From f0772ba0521cc4673e9e4750e9147ef7b54fba1b Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 29 Apr 2013 11:09:22 -0300 Subject: Fixes to the patch feature, contributed by Philipp Janda --- src/luarocks/tools/patch.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/luarocks/tools/patch.lua b/src/luarocks/tools/patch.lua index 9a89aa48..db1a9de5 100644 --- a/src/luarocks/tools/patch.lua +++ b/src/luarocks/tools/patch.lua @@ -295,7 +295,7 @@ function read_patch(filename, data) -- Accept a space as a terminator, like GNU patch does. -- Breaks patches containing filenames with spaces... -- FIXME Figure out what does GNU patch do in those cases. - local match = line:match("^--- ([^\t ]+)") + local match = line:match("^%-%-%- ([^\t ]+)") if not match then all_ok = false warning(format("skipping invalid filename at line %d", lineno+1)) @@ -329,7 +329,7 @@ function read_patch(filename, data) -- Accept a space as a terminator, like GNU patch does. -- Breaks patches containing filenames with spaces... -- FIXME Figure out what does GNU patch do in those cases. - local re_filename = "^%+%+%+ ([^ \t]+)" + local re_filename = "^%+%+%+ ([^ \t\r\n]+)" local match = line:match(re_filename) if not match then all_ok = false -- cgit v1.2.3-55-g6feb