X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fshellwords.pl;h=ca7dc7ec2356cfcfc9695346650195deb8fb3372;hb=bc4938c65d770a20856c44a0d21026bcc6f41d7b;hp=5d593daa50a24412aaf9fcbaa2e9d632f55362f7;hpb=2b69d0c297460bce3a8d8eefe2bd0de0a6451872;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/shellwords.pl b/lib/shellwords.pl index 5d593da..ca7dc7e 100644 --- a/lib/shellwords.pl +++ b/lib/shellwords.pl @@ -17,13 +17,14 @@ sub shellwords { while ($_ ne '') { $field = ''; for (;;) { - if (s/^"(([^"\\]|\\[\\"])*)"//) { + use re 'taint'; # leave strings tainted + if (s/^"(([^"\\]|\\.)*)"//) { ($snippet = $1) =~ s#\\(.)#$1#g; } elsif (/^"/) { die "Unmatched double quote: $_\n"; } - elsif (s/^'(([^'\\]|\\[\\'])*)'//) { + elsif (s/^'(([^'\\]|\\.)*)'//) { ($snippet = $1) =~ s#\\(.)#$1#g; } elsif (/^'/) {