This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #40921] shellwords.pl cannot handle trailing backslash
[perl5.git] / lib / Text / ParseWords.pm
index 1411986..78f7b24 100644 (file)
@@ -133,7 +133,7 @@ sub old_shellwords {
                Carp::carp("Unmatched single quote: $_");
                return();
            }
-           elsif (s/\A\\(.)//s) {
+           elsif (s/\A\\(.?)//s) {
                $snippet = $1;
            }
            elsif (s/\A([^\s\\'"]+)//) {