tests: fix shell quoting on native Windows Perl
Cherry-picked from #14949 Closes #15105
This commit is contained in:
parent
9c1ab7fa4a
commit
f88fb1c83e
@ -211,10 +211,15 @@ sub runclientoutput {
|
|||||||
#
|
#
|
||||||
sub shell_quote {
|
sub shell_quote {
|
||||||
my ($s)=@_;
|
my ($s)=@_;
|
||||||
if($s !~ m/^[-+=.,_\/:a-zA-Z0-9]+$/) {
|
if($^O eq 'MSWin32') {
|
||||||
# string contains a "dangerous" character--quote it
|
$s = '"' . $s . '"';
|
||||||
$s =~ s/'/'"'"'/g;
|
}
|
||||||
$s = "'" . $s . "'";
|
else {
|
||||||
|
if($s !~ m/^[-+=.,_\/:a-zA-Z0-9]+$/) {
|
||||||
|
# string contains a "dangerous" character--quote it
|
||||||
|
$s =~ s/'/'"'"'/g;
|
||||||
|
$s = "'" . $s . "'";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user