postgres.git / summary / log / commit / refs
commit 62d2caed62348994fb83cb105fcd2f4a247f5440
Author: Andrew Dunstan <andrew@dunslane.net>
Date: Fri Oct 04 19:34:40 2019 +0000
First released in: 13.0, 9.4.25, 9.5.20, 9.6.16, 10.11, 11.6, 12.1
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.
src/tools/msvc/Project.pm | 3 ++-
src/tools/msvc/Solution.pm | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/tools/msvc/Project.pm b/src/tools/msvc/Project.pm
index 9817b9439a9..1c9a8cda5c4 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 cb0edd387b6..06b479eced0 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -124,8 +124,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
[parent: 9faa9794f885]