Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5396)
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 {