From a4c04bdcc508b6a45f83e703d0f82401445aa55b Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Tue, 11 Sep 2001 01:00:31 +0100 Subject: Re: the remaining bugs in \x escapes (was Re: [PATCH] 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: <20010911000031.G1512@plum.flirble.org> p4raw-id: //depot/perl@11990 --- regcomp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'regcomp.c') diff --git a/regcomp.c b/regcomp.c index 3d75a484f5..4455730ed9 100644 --- a/regcomp.c +++ b/regcomp.c @@ -3039,7 +3039,8 @@ tryagain: vFAIL("Missing right brace on \\x{}"); } else { - I32 flags = PERL_SCAN_ALLOW_UNDERSCORES; + I32 flags = PERL_SCAN_ALLOW_UNDERSCORES + | PERL_SCAN_DISALLOW_PREFIX; numlen = e - p - 1; ender = grok_hex(p + 1, &numlen, &flags, NULL); if (ender > 0xff) @@ -3053,7 +3054,7 @@ tryagain: } } else { - I32 flags = 0; + I32 flags = PERL_SCAN_DISALLOW_PREFIX; numlen = 2; ender = grok_hex(p, &numlen, &flags, NULL); p += numlen; @@ -3449,7 +3450,8 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state) case 'a': value = ASCII_TO_NATIVE('\007');break; case 'x': if (*RExC_parse == '{') { - I32 flags = PERL_SCAN_ALLOW_UNDERSCORES; + I32 flags = PERL_SCAN_ALLOW_UNDERSCORES + | PERL_SCAN_DISALLOW_PREFIX; e = strchr(RExC_parse++, '}'); if (!e) vFAIL("Missing right brace on \\x{}"); @@ -3459,7 +3461,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state) RExC_parse = e + 1; } else { - I32 flags = 0; + I32 flags = PERL_SCAN_DISALLOW_PREFIX; numlen = 2; value = grok_hex(RExC_parse, &numlen, &flags, NULL); RExC_parse += numlen; -- cgit v1.2.1