From: Viktor Szakats Date: Fri, 20 Sep 2024 13:10:42 +0000 (+0200) Subject: tests: fix shell quoting on native Windows Perl X-Git-Tag: curl-8_11_0~273 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f88fb1c83e277447df508b2bbe368ae5b4d2b9b6;p=thirdparty%2Fcurl.git tests: fix shell quoting on native Windows Perl Cherry-picked from #14949 Closes #15105 --- diff --git a/tests/testutil.pm b/tests/testutil.pm index 51b1ba16ec..bccf75185e 100644 --- a/tests/testutil.pm +++ b/tests/testutil.pm @@ -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; }