This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix broken parsing of /\x{ab}/
authorGurusamy Sarathy <gsar@cpan.org>
Wed, 3 May 2000 18:34:01 +0000 (18:34 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Wed, 3 May 2000 18:34:01 +0000 (18:34 +0000)
p4raw-id: //depot/perl@6057

regcomp.c
t/pragma/utf8.t

index 9543710..89b3e53 100644 (file)
--- 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--;
index 79596ab..16a1586 100755 (executable)
@@ -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
 }