diff options
author | Richard Levitte <levitte@openssl.org> | 2018-02-16 23:28:31 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2018-02-19 10:47:37 +0000 |
commit | 5845f7de8165f35829e49acd41f6a2fc3698f221 (patch) | |
tree | 71258192e66db19024b230fdf6d365c35cd21b42 /util | |
parent | b45497c3371e218867d7ad43da8f99c34a32f635 (diff) |
OpenSSL::Test::quotify: put quotes around empty arguments
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5396)
Diffstat (limited to 'util')
-rw-r--r-- | util/perl/OpenSSL/Test.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/util/perl/OpenSSL/Test.pm b/util/perl/OpenSSL/Test.pm index e363a48473..ad77896c85 100644 --- a/util/perl/OpenSSL/Test.pm +++ b/util/perl/OpenSSL/Test.pm @@ -760,12 +760,13 @@ I<This must never ever be done on VMS.> 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 { @@ -775,7 +776,7 @@ sub quotify { } elsif ( $^O eq "MSWin32") { # MSWin setup $arg_formatter = sub { $_ = shift; - if (/\s|["\|\&\*\;<>]/) { + if ($_ eq '' || /\s|["\|\&\*\;<>]/) { s/(["\\])/\\$1/g; '"'.$_.'"'; } else { |