From: Richard Levitte Date: Fri, 16 Feb 2018 22:28:31 +0000 (+0100) Subject: OpenSSL::Test::quotify: put quotes around empty arguments X-Git-Tag: OpenSSL_1_1_0h~70 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d615c80a4fe12a983380106bd3b4c6b34bf8d982;p=oweals%2Fopenssl.git OpenSSL::Test::quotify: put quotes around empty arguments Reviewed-by: Paul Dale Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/5396) (cherry picked from commit 5845f7de8165f35829e49acd41f6a2fc3698f221) --- diff --git a/util/perl/OpenSSL/Test.pm b/util/perl/OpenSSL/Test.pm index f8805a6db0..eacbd68170 100644 --- a/util/perl/OpenSSL/Test.pm +++ b/util/perl/OpenSSL/Test.pm @@ -667,12 +667,13 @@ I sub quotify { # Unix setup (default if nothing else is mentioned) my $arg_formatter = - sub { $_ = shift; /\s|[\{\}\\\$\[\]\*\?\|\&:;<>]/ ? "'$_'" : $_ }; + sub { $_ = shift; + ($_ eq '' || /\s|[\{\}\\\$\[\]\*\?\|\&:;<>]/) ? "'$_'" : $_ }; if ( $^O eq "VMS") { # VMS setup $arg_formatter = sub { $_ = shift; - if (/\s|["[:upper:]]/) { + if ($_ eq '' || /\s|["[:upper:]]/) { s/"/""/g; '"'.$_.'"'; } else { @@ -682,7 +683,7 @@ sub quotify { } elsif ( $^O eq "MSWin32") { # MSWin setup $arg_formatter = sub { $_ = shift; - if (/\s|["\|\&\*\;<>]/) { + if ($_ eq '' || /\s|["\|\&\*\;<>]/) { s/(["\\])/\\$1/g; '"'.$_.'"'; } else {