Skip to content

Commit 8f88090

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 b6a6c12 commit 8f88090

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
@@ -133,8 +133,9 @@ sub GetOpenSSLVersion
133133

134134
# Attempt to get OpenSSL version and location. This assumes that
135135
# openssl.exe is in the specified directory.
136+
# Quote the .exe name in case it has spaces
136137
my $opensslcmd =
137-
$self->{options}->{openssl} . "\\bin\\openssl.exe version 2>&1";
138+
qq("$self->{options}->{openssl}\\bin\\openssl.exe" version 2>&1);
138139
my $sslout = `$opensslcmd`;
139140

140141
$? >> 8 == 0

0 commit comments

Comments
 (0)