mirror of
https://github.com/curl/curl.git
synced 2025-02-17 14:59:45 +08:00
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 {
|
||||
my ($s)=@_;
|
||||
if($s !~ m/^[-+=.,_\/:a-zA-Z0-9]+$/) {
|
||||
# string contains a "dangerous" character--quote it
|
||||
$s =~ s/'/'"'"'/g;
|
||||
$s = "'" . $s . "'";
|
||||
if($^O eq 'MSWin32') {
|
||||
$s = '"' . $s . '"';
|
||||
}
|
||||
else {
|
||||
if($s !~ m/^[-+=.,_\/:a-zA-Z0-9]+$/) {
|
||||
# string contains a "dangerous" character--quote it
|
||||
$s =~ s/'/'"'"'/g;
|
||||
$s = "'" . $s . "'";
|
||||
}
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user