summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@khw-desktop.(none)>2010-05-30 13:05:48 -0600
committerRafael Garcia-Suarez <rgs@consttype.org>2010-05-30 23:29:11 +0200
commit1408fb84de0c28007d91730cde177d893e427181 (patch)
tree4b95429ccf62b848f39468315890ae74192a32e9 /util.c
parent71648f9a69cff1f8ee90adfed51c64c3c2dfeaf1 (diff)
downloadperl-1408fb84de0c28007d91730cde177d893e427181.tar.gz
PATCH: [perl #75138] "\c`" -> " "
Attached is a patch for some of this issue. I took Nicholas' advice, and if the result of \cX isn't a word character, the output message will precede it with a backslash, so the message in the example would be "\c`" more clearly written simply as "\ " at -e line 1. I think that message is true. I also added tests. There is a test that guarantees that we won't ship 5.14 with things as they are now in it. I added wording to the comments next to that test to be sure to verify with this email thread if we should remove the deprecation, and mentioned that in the explanatory wording in the pod. I support removing the deprecation, but for now I'm not touching that, to see what other issues may yet arise before 5.14.
Diffstat (limited to 'util.c')
-rw-r--r--util.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/util.c b/util.c
index 5e7a24ea41..75c4808956 100644
--- a/util.c
+++ b/util.c
@@ -3855,10 +3855,18 @@ Perl_grok_bslash_c(pTHX_ const char source, const bool output_warning)
Perl_croak(aTHX_ "It is proposed that \"\\c{\" no longer be valid. It has historically evaluated to\n \";\". If you disagree with this proposal, send email to perl5-porters@perl.org\nOtherwise, or in the meantime, you can work around this failure by changing\n\"\\c{\" to \";\"");
}
else if (output_warning) {
+ U8 clearer[3];
+ U8 i = 0;
+ if (! isALNUM(result)) {
+ clearer[i++] = '\\';
+ }
+ clearer[i++] = result;
+ clearer[i++] = '\0';
+
Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
- "\"\\c%c\" more clearly written simply as \"%c\"",
+ "\"\\c%c\" more clearly written simply as \"%s\"",
source,
- result);
+ clearer);
}
}