We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e56d8d commit 3e89ae2Copy full SHA for 3e89ae2
xtra/PATCH.LUA
@@ -45,13 +45,18 @@ local function patch(p)
45
bf:close()
46
end
47
48
- for l in pf:lines() do
+ local n=pf:read("*l")
49
+ while n do
50
+ local l=n n=pf:read("*l")
51
local ls = l:sub(1, 1)
52
if ls == "+" then
53
if l:sub(2,4) == "++ " then
54
--TODO: Just ignore this line?
55
else
- if of then of:write(l:sub(2) .. '\n') ol = ol + 1 end
56
+ if of then
57
+ local nl = n and n:match("^\\ No newline at end of file")
58
+ of:write(l:sub(2)..(nl and""or'\n')) ol = ol + 1
59
+ end
60
61
elseif ls == '-' then
62
if l:sub(2,4) == "-- " then
0 commit comments