This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c: Un-special case something
authorKarl Williamson <khw@cpan.org>
Tue, 14 Feb 2017 02:12:31 +0000 (19:12 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 14 Feb 2017 04:24:10 +0000 (21:24 -0700)
By refactoring slightly, we make this code in a switch statement
have the same entrance and exit invariants as the other cases, so they
all can be handled uniformly at the end of the switch.

toke.c

diff --git a/toke.c b/toke.c
index 880ac53..547e67a 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -3934,7 +3934,7 @@ S_scan_const(pTHX_ char *start)
            case 'c':
                s++;
                if (s < send) {
-                   *d++ = grok_bslash_c(*s++, 1);
+                   *d++ = grok_bslash_c(*s, 1);
                }
                else {
                    yyerror("Missing control char name in \\c");
@@ -3942,7 +3942,7 @@ S_scan_const(pTHX_ char *start)
 #ifdef EBCDIC
                 non_portable_endpoint++;
 #endif
-               continue;
+                break;
 
            /* printf-style backslashes, formfeeds, newlines, etc */
            case 'b':