This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Change Debug output of char classes
authorKarl Williamson <public@khwilliamson.com>
Sun, 28 Jul 2013 01:10:27 +0000 (19:10 -0600)
committerKarl Williamson <public@khwilliamson.com>
Tue, 30 Jul 2013 18:05:47 +0000 (12:05 -0600)
This commit causes the debug output that was formerly "\x4ff", for
example to be \x{4f}f.  It always puts braces around the hex to separate
it from other characters.

regcomp.c

index b3c66b8..fdd8493 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -15491,12 +15491,7 @@ S_put_byte(pTHX_ SV *sv, int c)
             case '\a': Perl_sv_catpvf(aTHX_ sv, "\\a"); break;
 
             default:
             case '\a': Perl_sv_catpvf(aTHX_ sv, "\\a"); break;
 
             default:
-                if (c < 256) {
-                    Perl_sv_catpvf(aTHX_ sv, "\\x%02x", c);
-                }
-                else {
-                    Perl_sv_catpvf(aTHX_ sv, "\\x{%x}", c);
-                }
+                Perl_sv_catpvf(aTHX_ sv, "\\x{%x}", c);
                 break;
         }
     }
                 break;
         }
     }