aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2017-03-28 09:00:59 -0400
committerPeter Eisentraut <peter_e@gmx.net>2017-03-28 09:00:59 -0400
commit4d33a7f2e714848ca7b5b7ef8e244eead078ca13 (patch)
treecd1ce20e46e8124398d67db91e2c1cbf2ca0d33c
parenta6f22e83562d8b78293229587cd3d9430d16d466 (diff)
downloadpostgresql-4d33a7f2e714848ca7b5b7ef8e244eead078ca13.tar.gz
postgresql-4d33a7f2e714848ca7b5b7ef8e244eead078ca13.zip
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 <ilmari@ilmari.org>
-rw-r--r--src/tools/msvc/vcregress.pl8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index d9367f8fd5a..8933920d9bf 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -520,11 +520,9 @@ sub fetchRegressOpts
# Substitute known Makefile variables, then ignore options that retain
# an unhandled variable reference. Ignore anything that isn't an
# option starting with "--".
- @opts = grep {
- my $x = $_;
- $x =~ s/\Q$(top_builddir)\E/\"$topdir\"/;
- $x !~ /\$\(/ && $x =~ /^--/
- } split(/\s+/, $1);
+ @opts = grep { !/\$\(/ && /^--/ }
+ map { (my $x = $_) =~ s/\Q$(top_builddir)\E/\"$topdir\"/; $x; }
+ split(/\s+/, $1);
}
if ($m =~ /^\s*ENCODING\s*=\s*(\S+)/m)
{