summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-05-02 06:48:19 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-05-02 06:48:19 +0000
commitb21ed0a92b5a07dd021a85728802e72edfa03699 (patch)
tree2bca4101a44803d4b5c72468e9d4dc24f12743a5 /toke.c
parenta6b2f353992254a6ec5c40c60b053f7a6817c8e4 (diff)
downloadperl-b21ed0a92b5a07dd021a85728802e72edfa03699.tar.gz
change#3798 broke the meaning of "\0_7_7", tr/\0_// etc.; fix it
such that underscores are only ignored in literal numbers, "\x{...}", and hex/oct argument p4raw-link: @3798 on //depot/cfgperl: 252aa0820e6bce274b33bd342cfc65e18a59a165 p4raw-id: //depot/perl@6044
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/toke.c b/toke.c
index 860e3c1f8c..10273a0111 100644
--- a/toke.c
+++ b/toke.c
@@ -1389,6 +1389,7 @@ S_scan_const(pTHX_ char *start)
/* \132 indicates an octal constant */
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
+ len = 0; /* disallow underscores */
uv = (UV)scan_oct(s, 3, &len);
s += len;
goto NUM_ESCAPE_INSERT;
@@ -1402,10 +1403,12 @@ S_scan_const(pTHX_ char *start)
yyerror("Missing right brace on \\x{}");
e = s;
}
+ len = 1; /* allow underscores */
uv = (UV)scan_hex(s + 1, e - s - 1, &len);
s = e + 1;
}
else {
+ len = 0; /* disallow underscores */
uv = (UV)scan_hex(s, 2, &len);
s += len;
}