In bisect-runner.pl, make the code to report patching errors more robust.
authorNicholas Clark <nick@ccl4.org>
Fri, 28 Oct 2011 11:02:10 +0000 (13:02 +0200)
committerNicholas Clark <nick@ccl4.org>
Fri, 28 Oct 2011 11:02:10 +0000 (13:02 +0200)
Previously it was relying on matching an optional part of the patch to get
the name of the file. Now it matches a mandatory part of the patch to get it.

Porting/bisect-runner.pl

index 92e6e2d..44a321b 100755 (executable)
@@ -449,7 +449,7 @@ sub edit_file {
 sub apply_patch {
     my $patch = shift;
 
-    my ($file) = $patch =~ qr!^diff.*a/(\S+) b/\1!;
+    my ($file) = $patch =~ qr!^--- a/(\S+)\n\+\+\+ b/\1!sm;
     open my $fh, '|-', 'patch', '-p1' or die "Can't run patch: $!";
     print $fh $patch;
     return if close $fh;