mirror of
https://github.com/curl/curl.git
synced 2026-05-18 02:26:20 +03:00
tests: fix shell quoting on native Windows Perl
Cherry-picked from #14949 Closes #15105
This commit is contained in:
parent
9c1ab7fa4a
commit
f88fb1c83e
1 changed files with 9 additions and 4 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue