From: Gurusamy Sarathy Date: Wed, 3 May 2000 18:34:01 +0000 (+0000) Subject: fix broken parsing of /\x{ab}/ X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=de35ba6fa6685dd401ba3904290b7c5d67884c23;p=p5sagit%2Fp5-mst-13.2.git fix broken parsing of /\x{ab}/ p4raw-id: //depot/perl@6057 --- diff --git a/regcomp.c b/regcomp.c index 9543710..89b3e53 100644 --- a/regcomp.c +++ b/regcomp.c @@ -2606,7 +2606,7 @@ tryagain: FAIL("Missing right brace on \\x{}"); else if (UTF) { numlen = 1; /* allow underscores */ - ender = (UV)scan_hex(p + 1, e - p, &numlen); + ender = (UV)scan_hex(p + 1, e - p - 1, &numlen); /* numlen is generous */ if (numlen + len >= 127) { p--; diff --git a/t/pragma/utf8.t b/t/pragma/utf8.t index 79596ab..16a1586 100755 --- a/t/pragma/utf8.t +++ b/t/pragma/utf8.t @@ -10,7 +10,7 @@ BEGIN { } } -print "1..60\n"; +print "1..61\n"; my $test = 1; @@ -265,4 +265,7 @@ sub ok { $test++; # 60 } + + ok "\x{ab}" =~ /^\x{ab}$/, 1; + $test++; # 61 }