Skip to content

Commit 62d2cae

Browse files
committed
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.
1 parent 9faa979 commit 62d2cae

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/tools/msvc/Project.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ sub AddLibrary
126126
{
127127
my ($self, $lib, $dbgsuffix) = @_;
128128

129-
if ($lib =~ m/\s/)
129+
# quote lib name if it has spaces and isn't already quoted
130+
if ($lib =~ m/\s/ && $lib !~ m/^[&]quot;/)
130131
{
131132
$lib = '"' . $lib . """;
132133
}

src/tools/msvc/Solution.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ sub GetOpenSSLVersion
124124

125125
# Attempt to get OpenSSL version and location. This assumes that
126126
# openssl.exe is in the specified directory.
127+
# Quote the .exe name in case it has spaces
127128
my $opensslcmd =
128-
$self->{options}->{openssl} . "\\bin\\openssl.exe version 2>&1";
129+
qq("$self->{options}->{openssl}\\bin\\openssl.exe" version 2>&1);
129130
my $sslout = `$opensslcmd`;
130131

131132
$? >> 8 == 0

0 commit comments

Comments
 (0)