From: Andrew Dunstan Date: Fri, 4 Oct 2019 19:34:40 +0000 (-0400) Subject: Handle spaces in OpenSSL install location for MSVC X-Git-Tag: REL9_4_25~35 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=8f88090914431b946892069add6949812bb53610;p=postgresql.git Handle spaces in OpenSSL install location for MSVC 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. --- diff --git a/src/tools/msvc/Project.pm b/src/tools/msvc/Project.pm index 9ca5b1f13ad..f99f5ea52f9 100644 --- a/src/tools/msvc/Project.pm +++ b/src/tools/msvc/Project.pm @@ -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 = '"' . $lib . """; } diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index cccc9df5257..facf3489fb7 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -133,8 +133,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