diff options
author | Nicholas Clark <nick@ccl4.org> | 2001-09-04 23:42:50 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-09-05 11:30:59 +0000 |
commit | 53305cf15fa20bba9e66475dfc049c6ed9d96c55 (patch) | |
tree | 104f5d438fc2b971aa33cbff0bb5d76ef0154a7c /toke.c | |
parent | ea7154893ee587d7e47bcebff9e70757b48a38bd (diff) | |
download | perl-53305cf15fa20bba9e66475dfc049c6ed9d96c55.tar.gz |
oct and hex in glorious 64 bit (with less bugs) (was Re: hex and oct again (was Re: FreeBSD MD5 crypt? Re: crypt/hex/oct and Unicode?))
Message-ID: <20010904224250.P25120@plum.flirble.org>
p4raw-id: //depot/perl@11874
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -1434,8 +1434,9 @@ S_scan_const(pTHX_ char *start) case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { - STRLEN len = 0; /* disallow underscores */ - uv = (UV)scan_oct(s, 3, &len); + I32 flags = 0; + STRLEN len = 3; + uv = grok_oct(s, &len, &flags, NULL); s += len; } goto NUM_ESCAPE_INSERT; @@ -1445,20 +1446,23 @@ S_scan_const(pTHX_ char *start) ++s; if (*s == '{') { char* e = strchr(s, '}'); - STRLEN len = 1; /* allow underscores */ + I32 flags = PERL_SCAN_ALLOW_UNDERSCORES; + STRLEN len; + ++s; if (!e) { yyerror("Missing right brace on \\x{}"); - ++s; continue; } - uv = (UV)scan_hex(s + 1, e - s - 1, &len); + len = e - s; + uv = grok_hex(s, &len, &flags, NULL); s = e + 1; } else { { - STRLEN len = 0; /* disallow underscores */ - uv = (UV)scan_hex(s, 2, &len); + STRLEN len = 2; + I32 flags = 0; + uv = grok_hex(s, &len, &flags, NULL); s += len; } } |