Skip to content

Commit 13769c0

Browse files
committed
Fixed local variable skip possibly being assigned a negative value.
1 parent b0b0f93 commit 13769c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xtra/PATCH.LUA

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ local function patch(p)
102102
hunk=parseHunkHeader()
103103
if hunk then
104104
io.write("\t@@ -" .. hunk.old.start .. "," .. hunk.old.lines .. " +" .. hunk.new.start .. "," .. hunk.new.lines .. " @@: ")
105-
local skip, line = hunk.old.start - 1
105+
local skip, line = hunk.old.start > 0 and hunk.old.start - 1 or 0
106106
if hunk.new.start - 1 ~= skip then print("malformed")os.exit(1) end
107107
while bl < skip do
108108
line, bl = bf:read("*l"), bl + 1

0 commit comments

Comments
 (0)