]> granicus.if.org Git - postgresql/commitdiff
Fix Perl code which had broken the Windows build
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 28 Mar 2017 13:00:59 +0000 (09:00 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 28 Mar 2017 13:00:59 +0000 (09:00 -0400)
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>

src/tools/msvc/vcregress.pl

index d9367f8fd5a83821b1301b6cf2a608a1810cb4e4..8933920d9bf631359abd01f1222956987dc2b8aa 100644 (file)
@@ -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)
        {