This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: Generalize stdize_locale()
authorKarl Williamson <khw@cpan.org>
Sun, 11 Apr 2021 01:44:16 +0000 (19:44 -0600)
committerKarl Williamson <khw@cpan.org>
Wed, 10 Aug 2022 00:05:59 +0000 (18:05 -0600)
commit32899cfbfbeefbe5023d40fcf4ed4420752f9b20
treeb72926a8973f9006f35dc2d1cc6b26c030951580
parent82e2ef274609fbe3e9e3a0c11bab9b6ef9b3d959
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.
embed.fnc
embed.h
embedvar.h
intrpvar.h
locale.c
perl.c
proto.h
sv.c