summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2019-10-04 15:34:40 -0400
committerAndrew Dunstan <andrew@dunslane.net>2019-10-04 15:39:02 -0400
commit1e9a0487d6a176b1ac4770d4406aac19da16f598 (patch)
treed253e1bca10cd62dcf7b144f996b76acaba650a8 /src
parent30e5b3bbe9ca9f3594816788fe4469798da04f64 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/tools/msvc/Project.pm3
-rw-r--r--src/tools/msvc/Solution.pm3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/tools/msvc/Project.pm b/src/tools/msvc/Project.pm
index faf1a683f66..418db2b0bde 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 = '&quot;' . $lib . "&quot;";
}
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 027f098162e..7ec71204db2 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -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