Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4d33a7f

Browse files
committed
Fix Perl code which had broken the Windows build
The previous change wanted to avoid modifying $_ in grep, but the code just made the change in a local variable and then lost it. Rewrite the code using a separate map and grep, which is clearer anyway. Author: Dagfinn Ilmari Mannsåker <[email protected]>
1 parent a6f22e8 commit 4d33a7f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/tools/msvc/vcregress.pl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -520,11 +520,9 @@ sub fetchRegressOpts
520520
# Substitute known Makefile variables, then ignore options that retain
521521
# an unhandled variable reference. Ignore anything that isn't an
522522
# option starting with "--".
523-
@opts = grep {
524-
my $x = $_;
525-
$x =~ s/\Q$(top_builddir)\E/\"$topdir\"/;
526-
$x !~ /\$\(/ && $x =~ /^--/
527-
} split(/\s+/, $1);
523+
@opts = grep { !/\$\(/ && /^--/ }
524+
map { (my $x = $_) =~ s/\Q$(top_builddir)\E/\"$topdir\"/; $x; }
525+
split(/\s+/, $1);
528526
}
529527
if ($m =~ /^\s*ENCODING\s*=\s*(\S+)/m)
530528
{

0 commit comments

Comments
 (0)