Branch: refs/heads/smoke-me/khw-locale3
Home: https://github.com/Perl/perl5
Commit: cfa691fe9e8617f99795bb188f2cacf30bf9dad6
https://github.com/Perl/perl5/commit/cfa691fe9e8617f99795bb188f2cacf30bf9dad6
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M sv.c
Log Message:
-----------
sv.c: Move some initialization inside #ifdef
If not using the feature, don't need to initialize it.
Commit: 5412369387c64121aadb6129f7a89f5d0e434e9e
https://github.com/Perl/perl5/commit/5412369387c64121aadb6129f7a89f5d0e434e9e
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M embed.fnc
M intrpvar.h
M locale.c
M proto.h
Log Message:
-----------
Make two locale PL_ strings const char*
This adds some compile safety to these.
Commit: 0e3b0519bb3f87e3eea174867bb897dc174b68e3
https://github.com/Perl/perl5/commit/0e3b0519bb3f87e3eea174867bb897dc174b68e3
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M embed.fnc
M embed.h
M embedvar.h
M intrpvar.h
M locale.c
M perl.c
M proto.h
M sv.c
Log Message:
-----------
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 being
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.
Commit: 5c2f3483323db507e7842d6ae6e13149d477e4b9
https://github.com/Perl/perl5/commit/5c2f3483323db507e7842d6ae6e13149d477e4b9
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Refactor some derived #defines
The _c suffix is supposed to mean the category is known at compile time.
In some configurations this does not matter, and so I had named things
carelessly, so this might be confusing. This commit fixes that.
Commit: 48fc572fd3fef29129e3d98fa84c7ae62640219a
https://github.com/Perl/perl5/commit/48fc572fd3fef29129e3d98fa84c7ae62640219a
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use setlocale() for init, not P2008
We have found bugs in the POSIX 2008 libc implementations on various
platforms. This code, which does the initialization of locale handling
has always been very conservative, expecting possible failures due to
bugs in it our the libc implementations, and backing out if necessary to
a crippled, but workable state, if something goes wrong.
I think we should use the oldest, most stable locale implementation in
these circumstances
Commit: b1aa17e1c6669c3e77750a39aa57714b3f4f9571
https://github.com/Perl/perl5/commit/b1aa17e1c6669c3e77750a39aa57714b3f4f9571
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
setlocale_failure_panic_i now used more generally
This function was #ifdef'd out of being defined to silence a compiler
warning in some configurations. It's about to be used more generally,
so needs to be generally accessible
Commit: 7fba688097bc09d112240e4f2da5cdf6a9c6ec0e
https://github.com/Perl/perl5/commit/7fba688097bc09d112240e4f2da5cdf6a9c6ec0e
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Split aggregate LC_ALL from emulate_setlocale
This splits into a separate function the code necessary in some
Configurations to calculate LC_ALL from a potentially disparate
aggregate of categories having different locales.
This is being done just for readability, as this extensive code in the
middle of something else distracts from the main point.
A goto is hence replaced by a recursive call.
Commit: e93923ee5802692f0d6117cbbcfc00df06b26af2
https://github.com/Perl/perl5/commit/e93923ee5802692f0d6117cbbcfc00df06b26af2
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M embed.fnc
M locale.c
M proto.h
Log Message:
-----------
locale.c: Change internal variable name
The new name better reflects its purpose, so is less confusing
Commit: d0b97329272b96e85f806182ba163a6c7bf824f1
https://github.com/Perl/perl5/commit/d0b97329272b96e85f806182ba163a6c7bf824f1
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Clean up handling of a glibc bug
This commit moves all mention of this bug to just the code that requires
it, and inlines a macro, making it easier to comprehend
Commit: 126c98a16da592266350e2cbbeb2967dadd3d170
https://github.com/Perl/perl5/commit/126c98a16da592266350e2cbbeb2967dadd3d170
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Split ancillary from S_emulate_setlocale
This takes the code to update LC_ALL, used only in some Configurations,
out of the main line, making the main line more readable.
It also allows the removal of temporary code added a few commits back
Commit: b6f6349d3fdd0c1ea93ef3385f8d920df0acdff6
https://github.com/Perl/perl5/commit/b6f6349d3fdd0c1ea93ef3385f8d920df0acdff6
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: locale "" can be disparate
Setting a locale "" means to get the value from environment variables.
These can set locale categories to different locales, and this needs to
be handled. The logic before this commit only handled the disparate
case when the locale wasn't ""; but this was compensated for elsewhere.
A future commit will remove that compensation.
Commit: 6e16612ee892cff0053904f29697899527f05152
https://github.com/Perl/perl5/commit/6e16612ee892cff0053904f29697899527f05152
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
Split off setting locale to "" from S_emulate_setlocale
This is done for readability, to move the special casing of setting a
locale to the empty string (hence getting it from the environment) out
of the main line code.
Commit: 0b3234950435327719deaadc74c1e675c285dda1
https://github.com/Perl/perl5/commit/0b3234950435327719deaadc74c1e675c285dda1
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M sv.c
Log Message:
-----------
sv.c: Duplicate more variables during cloning
These locale-related ones should be getting initialized in the new
thread, but be certain.
Commit: ccf111318ba92e129456be760a4da10630519771
https://github.com/Perl/perl5/commit/ccf111318ba92e129456be760a4da10630519771
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M embed.fnc
M embed.h
M embedvar.h
M intrpvar.h
M locale.c
M makedef.pl
M perl.c
M proto.h
M sv.c
Log Message:
-----------
locale.c: Add fcn to hide edge case undefined behavior
The POSIX 2008 API has an edge case in that the result of most of the
functions when called with a global (as opposed to a per-thread) locale
is undefined.
The duplocale() function is the exception which will create a per-thread
locale containing the values copied from the global one.
This commit just calls duplocale, if needed, and the caller need not
concern itself with this possibility
Commit: a8db20de606e7bcbd99810a7966877c40305a3e9
https://github.com/Perl/perl5/commit/a8db20de606e7bcbd99810a7966877c40305a3e9
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M proto.h
Log Message:
-----------
locale.c: Add DEBUGGING information
These functions are called as expansions of macros. It may be useful to
know where in the file the macro occurred.
Commit: edf0075fea7719b0ebbb78496852ad2cbe2acf8a
https://github.com/Perl/perl5/commit/edf0075fea7719b0ebbb78496852ad2cbe2acf8a
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M locale.c
Log Message:
-----------
Don't discard locale info in starting P2008
The program is started in the global locale, and then is converted to
the POSIX 2008 per-thread locale API. Prior to this commit the startup
locale was discarded. It really should be the foundation for the 2008
locales. I don't know of any current paths through the code that this
makes a difference for, but it is a potential hole that is easy to plug.
Commit: 74c74d506a3ecb52314de7ade1743169c1f4d686
https://github.com/Perl/perl5/commit/74c74d506a3ecb52314de7ade1743169c1f4d686
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M embed.fnc
M embed.h
M locale.c
M perl.h
M proto.h
Log Message:
-----------
Add a common locale panic macro and functions
This will make sure that all the necessary clean up gets done.
Commit: 04eec42a1a44f242737eab6482317399b9239c87
https://github.com/Perl/perl5/commit/04eec42a1a44f242737eab6482317399b9239c87
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M locale.c
M perl.h
Log Message:
-----------
Swap the ordering of two locale category indices
Perl internally uses a mapping of locale category values into a
consecutive sequence of indices starting at 0. These are used as
indexes into arrays. The reason is that the category numbers are
opaque, vary by platform, aren't necessarily sequential, and hence are
hard to make table driven code for.
This commit makes the LC_CTYPE index 0, and LC_NUMERIC equal to 1;
swapping them. The reason is to cause LC_CTYPE to get done first in the
many loops through the categories. The UTF8ness of categories is an
often needed value, and most of the time the categories will have the
same locale. LC_CTYPE is needed to calculate the UTF8ness, and by doing
it first and caching the result, the other categories likely
automatically will use the same value, without having to recalculate.
Commit: 80abeca64dd0037a20d122bd201c173404045293
https://github.com/Perl/perl5/commit/80abeca64dd0037a20d122bd201c173404045293
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Use DEBUG_(PRE|POST_)STMTS to save/restore errno
Instead of explicitly saving the errno around debugging statements, the
more general mechanism is used.
Commit: 77c4c220374c719bb3fc164f7691690726fa163a
https://github.com/Perl/perl5/commit/77c4c220374c719bb3fc164f7691690726fa163a
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Change assert() into STATIC_ASSERT()
Commit: 0e90ce057206b68765bbace5192b087d31dcbedc
https://github.com/Perl/perl5/commit/0e90ce057206b68765bbace5192b087d31dcbedc
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Add check that strxfrm didn't fail
The code failed to take into account that strxfrm() can fail for reasons
besides buffer length. It does not return errors, and the only way to
check is to set errno to 0 beforehand, and check that it is still 0
afterwards.
Commit: 7e7d85dbf2676ce982cdc378dac59643143009c5
https://github.com/Perl/perl5/commit/7e7d85dbf2676ce982cdc378dac59643143009c5
Author: Karl Williamson <[email protected]>
Date: 2022-07-16 (Sat, 16 Jul 2022)
Changed paths:
M locale.c
Log Message:
-----------
locale.c: Print code point in hex, not decimal
Hex is the more familiar form
Compare: https://github.com/Perl/perl5/compare/29bce82f561d...7e7d85dbf267