Skip to content

Commit 8aafcd8

Browse files
committed
Move split helper function back into parseHunkHeader as it's not used elsewhere.
1 parent 60e3fad commit 8aafcd8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

xtra/PATCH.LUA

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ local function patch(p)
44
local pf, e = io.open(p)
55
if not pf then print(e) os.exit(1) end
66

7-
local function split(i,d)
8-
local r={}
9-
for m in (i..d):gmatch("(.-)"..d)do table.insert(r,m)end
10-
return r
11-
end
12-
137
local function parseFileName(l)
148
local first = l:sub(5,5)
159
if first == '"' or first == "'" then
@@ -45,6 +39,11 @@ local function patch(p)
4539
elseif ls == '@' then
4640
if l:sub(2,3) == "@ " then
4741
local function parseHunkHeader()
42+
local function split(i,d)
43+
local r={}
44+
for m in (i..d):gmatch("(.-)"..d)do table.insert(r,m)end
45+
return r
46+
end
4847
local words,old,new=split(l," "),{},{}
4948
if words[2] then old=split(words[2],",")end
5049
if words[3] then new=split(words[3],",")end

0 commit comments

Comments
 (0)