From 32899cfbfbeefbe5023d40fcf4ed4420752f9b20 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 10 Apr 2021 19:44:16 -0600 Subject: locale.c: Generalize stdize_locale() This function is rewritten to handle LC_ALL, and to make it easier to add new checks. There is also a change, which I think is an improvement, in that everything starting with a \n is trimmed, instead of just a trailing \n. A couple of calls to stdize_locale() are removed, as they are redundant, because they are called only as a result of Perl_setlocale() being called, and that ends up calling stdize_locale always, early on. The call to savepv() is also moved in a couple cases to after the result is known to not be NULL I originally had such a new check in mind, but it turned out that doing it here didn't solve the problem, so this commit has been amended (before ever being pushed) to not include that. chomped. --- intrpvar.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'intrpvar.h') diff --git a/intrpvar.h b/intrpvar.h index cdca7e3e3a..d607e452dc 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -761,6 +761,8 @@ PERLVARI(I, langinfo_buf, char *, NULL) PERLVARI(I, langinfo_bufsize, Size_t, 0) PERLVARI(I, setlocale_buf, const char *, NULL) PERLVARI(I, setlocale_bufsize, Size_t, 0) +PERLVARI(I, stdize_locale_buf, const char *, NULL) +PERLVARI(I, stdize_locale_bufsize, Size_t, 0) #ifdef PERL_SAWAMPERSAND PERLVAR(I, sawampersand, U8) /* must save all match strings */ -- cgit v1.2.1