Subject: | File names not preserved in patch created with concatenated "diff -u"'s |
If a patch is created by concatenating the output of several "diff
-u"'s, it will be a valid patch, however PatchReader will not get the
separate file names and will only print one of them.
A patch with this issue looks like this:
--- filename.c.orig 2009-05-03
+++ filename.c 2009-06-07
@@ -3,5 +3,5 @@
aaa
bbb
-ccc
+ddd
eee
fff
--- otherfile.h.orig 2009-05-03
+++ otherfile.h 2009-06-07
@@ -4,5 +4,5 @@
111
222
-333
+444
555
666
I was able to fix it by triggering a "_maybe_end_file" where the /^---/
regular expression is found in Raw.pm.
I am attaching a patch to fix this issue.
Thanks,
Filipe
Subject: | patchreader_filename.patch |
--- Raw.pm.orig 2004-07-17 03:14:35.000000000 -0400
+++ Raw.pm 2009-07-06 14:57:52.000000000 -0400
@@ -42,6 +42,7 @@
# patch header parsing
if ($line =~ /^---\s*(\S+)\s*\t([^\t\r\n]*)\s*(\S*)/) {
+ $this->_maybe_end_file();
if ($1 eq "/dev/null") {
$this->{FILE_STATE}{is_add} = 1;
} else {