Skip to content

Commit c080c69

Browse files
committed
bisect-runner.pl shouldn't generate undef warnings from internal patches
The regex wasn't handling context diffs, and two of the unified diffs were generated with differing filenames and trailing timestamp text that it wasn't robust against.
1 parent e616aff commit c080c69

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Porting/bisect-runner.pl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,9 @@ sub apply_patch {
13981398
my ($patch, $what, $files) = @_;
13991399
$what = 'patch' unless defined $what;
14001400
unless (defined $files) {
1401-
$patch =~ m!^--- [ab]/(\S+)\n\+\+\+ [ba]/\1!sm;
1401+
# Handle context diffs (*** ---) and unified diffs (+++ ---)
1402+
# and ignore trailing "garbage" after the filenames
1403+
$patch =~ m!^[-*]{3} [ab]/(\S+)[^\n]*\n[-+]{3} [ba]/\1!sm;
14021404
$files = " $1";
14031405
}
14041406
my $patch_to_use = placate_patch_prog($patch);
@@ -4304,7 +4306,7 @@ sub patch_ext {
43044306
checkout_file('ext/DynaLoader/dl_dyld.xs', 'f556e5b971932902');
43054307
apply_patch(<<'EOPATCH');
43064308
diff -u a/ext/DynaLoader/dl_dyld.xs~ a/ext/DynaLoader/dl_dyld.xs
4307-
--- a/ext/DynaLoader/dl_dyld.xs~ 2011-10-11 21:41:27.000000000 +0100
4309+
--- a/ext/DynaLoader/dl_dyld.xs 2011-10-11 21:41:27.000000000 +0100
43084310
+++ b/ext/DynaLoader/dl_dyld.xs 2011-10-11 21:42:20.000000000 +0100
43094311
@@ -41,6 +41,35 @@
43104312
#include "perl.h"
@@ -4355,7 +4357,7 @@ sub patch_ext {
43554357
if ($major < 4 && !extract_from_file('util.c', qr/^form/m)) {
43564358
apply_patch(<<'EOPATCH');
43574359
diff -u a/ext/DynaLoader/dl_dyld.xs~ a/ext/DynaLoader/dl_dyld.xs
4358-
--- a/ext/DynaLoader/dl_dyld.xs~ 2011-10-11 21:56:25.000000000 +0100
4360+
--- a/ext/DynaLoader/dl_dyld.xs 2011-10-11 21:56:25.000000000 +0100
43594361
+++ b/ext/DynaLoader/dl_dyld.xs 2011-10-11 22:00:00.000000000 +0100
43604362
@@ -60,6 +60,18 @@
43614363
# define get_av perl_get_av

0 commit comments

Comments
 (0)