This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix quotewords
authorHugo van der Sanden <hv@crypt.compulink.co.uk>
Thu, 6 Mar 1997 07:55:25 +0000 (07:55 +0000)
committerChip Salzenberg <chip@atlantic.net>
Sat, 1 Mar 1997 06:40:49 +0000 (18:40 +1200)
Subject: Re: Fix for ::SUPER with UNIVERSAL

In <199703052319.SAA32568@rio.atlantic.net>, Chip Salzenberg writes:
:Cute.  It turns out that FileHandle and IO::Handle were okay, but the
:handling of ::SUPER (which is used by IO::Handle::new) was broken in
:the face of UNIVERSAL.
:
:Here's a patch.
That fixes it.
Here's one back - I think Text::ParseWords->quotewords is more broken than
this, but it's a start.

p5p-msgid: 199703060755.HAA15060@crypt.compulink.co.uk

lib/Text/ParseWords.pm

index f86c8c2..f2e1514 100644 (file)
@@ -95,12 +95,12 @@ sub quotewords {
     while (length($_)) {
        $field = '';
        for (;;) {
     while (length($_)) {
        $field = '';
        for (;;) {
-            $snippet = '';
-           if (s/^"(([^"\\]|\\[\\"])*)"//) {
+           $snippet = '';
+           if (s/^"(([^"\\]|\\.)*)"//) {
                $snippet = $1;
                 $snippet = "\"$snippet\"" if ($keep);
            }
                $snippet = $1;
                 $snippet = "\"$snippet\"" if ($keep);
            }
-           elsif (s/^'(([^'\\]|\\[\\'])*)'//) {
+           elsif (s/^'(([^'\\]|\\.)*)'//) {
                $snippet = $1;
                 $snippet = "'$snippet'" if ($keep);
            }
                $snippet = $1;
                 $snippet = "'$snippet'" if ($keep);
            }