File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -40,20 +40,30 @@ local function patch(p)
4040 -- TODO: New file
4141 print (" New File: '" .. parseFileName (l ) .. " '" )
4242 else
43- -- TODO: Add Line
44- print (" Add Line: '" .. l :sub (2 ) .. " '" )
43+ if of then of :write (l :sub (2 ) .. ' \n ' ) ol = ol + 1 end
4544 end
4645 elseif ls == ' -' then
4746 if l :sub (2 ,4 ) == " -- " then
48- -- TODO: Old file
49- print ( " Old File: ' " .. parseFileName ( l ) .. " ' " )
47+ local filename = parseFileName ( l )
48+ if setPatchFile ( filename ) then cp = filename end
5049 else
51- -- TODO: Del Line
52- print (" Del Line: '" .. l :sub (2 ) .. " '" )
50+ local cmp = bf :read (" *l" ) bl = bl + 1
51+ if cmp ~= l :sub (2 ) then
52+ print (" Malformed Hunk" )
53+ end
5354 end
5455 elseif ls == ' ' then
5556 -- TODO: context line verification
56- print (" Context: '" .. l :sub (2 ) .. " '" )
57+ local line = l :sub (2 )
58+ if bf then
59+ local cmp = bf :read (" *l" ) bl = bl + 1
60+ if cmp == line then
61+ if of then of :write (line .. ' \n ' ) ol = ol + 1 end
62+ else
63+ print (" Malformed Hunk" )
64+ end
65+ end
66+
5767 elseif ls == ' @' then
5868 if l :sub (2 ,3 ) == " @ " then
5969 local function parseHunkHeader ()
You can’t perform that action at this time.
0 commit comments