]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Handle spaces in OpenSSL install location for MSVC
authorAndrew Dunstan <andrew@dunslane.net>
Fri, 4 Oct 2019 19:34:40 +0000 (15:34 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Fri, 4 Oct 2019 19:39:02 +0000 (15:39 -0400)
First, make sure that the .exe name is quoted when trying to get the
version number. Also, don't quote the lib name for using in the project
files if it's already been quoted. This second change applies to all
libraries, not just OpenSSL.

This has clearly been broken forever, so backpatch to all live branches.

src/tools/msvc/Project.pm
src/tools/msvc/Solution.pm

index faf1a683f66c41c3038ef742c754cdfd0c667e07..418db2b0bde2e3cdd8d1cca8a0488976a04656c1 100644 (file)
@@ -126,7 +126,8 @@ sub AddLibrary
 {
        my ($self, $lib, $dbgsuffix) = @_;
 
-       if ($lib =~ m/\s/)
+       # quote lib name if it has spaces and isn't already quoted
+       if ($lib =~ m/\s/ && $lib !~ m/^[&]quot;/)
        {
                $lib = '&quot;' . $lib . "&quot;";
        }
index 027f098162e3bc7edc928877087f6fa205c48521..7ec71204db2e9bba29c6dc64b9cd2f92c0049435 100644 (file)
@@ -130,8 +130,9 @@ sub GetOpenSSLVersion
 
        # Attempt to get OpenSSL version and location.  This assumes that
        # openssl.exe is in the specified directory.
+       # Quote the .exe name in case it has spaces
        my $opensslcmd =
-         $self->{options}->{openssl} . "\\bin\\openssl.exe version 2>&1";
+         qq("$self->{options}->{openssl}\\bin\\openssl.exe" version 2>&1);
        my $sslout = `$opensslcmd`;
 
        $? >> 8 == 0