Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5396)
(cherry picked from commit
5845f7de8165f35829e49acd41f6a2fc3698f221)
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 {
} elsif ( $^O eq "MSWin32") { # MSWin setup
$arg_formatter = sub {
$_ = shift;
- if (/\s|["\|\&\*\;<>]/) {
+ if ($_ eq '' || /\s|["\|\&\*\;<>]/) {
s/(["\\])/\\$1/g;
'"'.$_.'"';
} else {