This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: -Dr \xZZ instead of \x{ZZ}
authorKarl Williamson <khw@cpan.org>
Thu, 11 Feb 2016 17:25:04 +0000 (10:25 -0700)
committerKarl Williamson <khw@cpan.org>
Fri, 19 Feb 2016 03:26:49 +0000 (20:26 -0700)
The brackets are unnecessary and clutter the output.

regcomp.c

index 6549508..af82a0d 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -19189,7 +19189,7 @@ S_put_code_point(pTHX_ SV *sv, UV c)
             Perl_sv_catpvf(aTHX_ sv, "%s", mnemonic);
         }
         else {
-            Perl_sv_catpvf(aTHX_ sv, "\\x{%02X}", (U8) c);
+            Perl_sv_catpvf(aTHX_ sv, "\\x%02X", (U8) c);
         }
     }
 }
@@ -19345,10 +19345,10 @@ S_put_range(pTHX_ SV *sv, UV start, const UV end, const bool allow_literals)
                     : NUM_ANYOF_CODE_POINTS - 1;
 #if NUM_ANYOF_CODE_POINTS > 256
         format = (this_end < 256)
-                 ? "\\x{%02"UVXf"}-\\x{%02"UVXf"}"
+                 ? "\\x%02"UVXf"-\\x%02"UVXf""
                  : "\\x{%04"UVXf"}-\\x{%04"UVXf"}";
 #else
-        format = "\\x{%02"UVXf"}-\\x{%02"UVXf"}";
+        format = "\\x%02"UVXf"-\\x%02"UVXf"";
 #endif
         GCC_DIAG_IGNORE(-Wformat-nonliteral);
         Perl_sv_catpvf(aTHX_ sv, format, start, this_end);