From 6726b4f40a8baa55f93e1dc39b22e799d43bd9d0 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 16 Mar 2018 13:57:00 -0600 Subject: [PATCH] locale.c: Clarify warning message When there are discrepancies in the locale and what Perl is expecting, a warning is raised listing the problematic characters. For \n, and \t, they should have been displayed as mnemonics, but a required backslash to escape things had been omitted, so they were displayed literally, so looked just like white space. Also, put any displayed blank in ' ' so it won't look like the list is empty. --- locale.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/locale.c b/locale.c index 7a0cd74..cb59929 100644 --- a/locale.c +++ b/locale.c @@ -1548,18 +1548,22 @@ S_new_ctype(pTHX_ const char *newctype) && (isGRAPH_A(i) || isBLANK_A(i) || i == '\n')) { bool is_bad = FALSE; - char name[3] = { '\0' }; + char name[4] = { '\0' }; /* Convert the name into a string */ - if (isPRINT_A(i)) { + if (isGRAPH_A(i)) { name[0] = i; name[1] = '\0'; } else if (i == '\n') { - my_strlcpy(name, "\n", sizeof(name)); + my_strlcpy(name, "\\n", sizeof(name)); + } + else if (i == '\t') { + my_strlcpy(name, "\\t", sizeof(name)); } else { - my_strlcpy(name, "\t", sizeof(name)); + assert(i == ' '); + my_strlcpy(name, "' '", sizeof(name)); } /* Check each possibe class */ -- 1.8.3.1