This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
dquote_static.c: Clarify code
authorKarl Williamson <khw@cpan.org>
Mon, 21 Apr 2014 18:11:40 +0000 (12:11 -0600)
committerKarl Williamson <khw@cpan.org>
Fri, 30 May 2014 15:32:08 +0000 (09:32 -0600)
We output the message when there is a printable ASCII character, so use
that as the test instead of complementing the test for a control.  This
makes the code somewhat clearer.

dquote_static.c

index 4c82c77..1f74ca5 100644 (file)
@@ -63,9 +63,7 @@ S_grok_bslash_c(pTHX_ const char source, const bool output_warning)
     }
 
     result = toCTRL(source);
-    if (output_warning && ! isCNTRL_L1(result)) {
-        /* We use isCNTRL_L1 above and not simply isCNTRL, because on EBCDIC
-         * machines, things like \cT map into a C1 control. */
+    if (output_warning && isPRINT_A(result)) {
         U8 clearer[3];
         U8 i = 0;
         if (! isWORDCHAR(result)) {