File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,18 @@ local function patch(p)
3333 return true
3434 end
3535
36+ local function writeRemainder ()
37+ if of then
38+ local rest = bf :read (" *l" )
39+ while rest do
40+ of :write (rest .. ' \n ' )
41+ rest = bf :read (" *l" )
42+ end
43+ of :close ()
44+ end
45+ bf :close ()
46+ end
47+
3648 for l in pf :lines () do
3749 local ls = l :sub (1 , 1 )
3850 if ls == " +" then
@@ -45,6 +57,7 @@ local function patch(p)
4557 if l :sub (2 ,4 ) == " -- " then
4658 local filename = parseFileName (l )
4759 if setPatchFile (filename ) then cp = filename end
60+ if bf then writeRemainder () end
4861 else
4962 local cmp = bf :read (" *l" ) bl = bl + 1
5063 if cmp ~= l :sub (2 ) then
@@ -99,6 +112,7 @@ local function patch(p)
99112 end
100113 end
101114 pf :close ()
115+ if bf then writeRemainder () end
102116end
103117
104118if # arg < 1 then os.exit (1 ) end
You can’t perform that action at this time.
0 commit comments