Branch: refs/heads/smoke-me/khw-env Home: https://github.com/Perl/perl5 Commit: 25963b58df93ee21d4a7957aa23c3454cbc962ce https://github.com/Perl/perl5/commit/25963b58df93ee21d4a7957aa23c3454cbc962ce Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023)
Changed paths: M locale.c Log Message: ----------- locale.c: Reorder code, add comments There are three separate implementations of an internal API for locale handling. This commit makes them stand out in the code, and makes the ordering within each implementation parallel to the other implementations. And adds explanatory comments. Commit: 4ba9f64c55b5546b54293d1998e71526d981bed0 https://github.com/Perl/perl5/commit/4ba9f64c55b5546b54293d1998e71526d981bed0 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Remove one-off macro This was used to prevent an unnecessary copy. But the next commit will change the macro it was avoiding to not always do the copy. That will avoid more copies than this would. The copy that results will still be unnecessary in some cases, but there is a net gain. Commit: d9e31d40602eebd47096ee69bc543e0a27083312 https://github.com/Perl/perl5/commit/d9e31d40602eebd47096ee69bc543e0a27083312 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Add a convenience macro query_nominal_locale_i This is used when the locale needs to be what an external caller would see. Adding this simplifies some code. Commit: 1d82adcd8264025c15e164e001dbc8298b637147 https://github.com/Perl/perl5/commit/1d82adcd8264025c15e164e001dbc8298b637147 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move copy from macro to called function Not all returns from the function need to be copied. Thus this eliminates some extraneous copies. Commit: f03085417f0064a0afdec06b436bbd5d39af29b8 https://github.com/Perl/perl5/commit/f03085417f0064a0afdec06b436bbd5d39af29b8 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- S_toggle_locale_i: Move some assert()s, initialization Commit: 5cddba0ac0463c0bfec7919b3c98d3f35034dd37 https://github.com/Perl/perl5/commit/5cddba0ac0463c0bfec7919b3c98d3f35034dd37 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M perl.h M proto.h Log Message: ----------- locale.c: Add extra debug info to panics This commit adds some call stack information to the message that gets output when about to panic because of an unanticipated failure in the locale handling code. Commit: adb159df7c4fd6819957bce2638e8679e3a7c35e https://github.com/Perl/perl5/commit/adb159df7c4fd6819957bce2638e8679e3a7c35e Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Add void_setlocale_with_caller macros These pass a file and line number of further up the calling stack to a panic so as to improve debugging information. Commit: 09fcc26497727597efa4e1136e54e31a0160a95d https://github.com/Perl/perl5/commit/09fcc26497727597efa4e1136e54e31a0160a95d Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Initialize PL_curlocales at startup Previously this was done later, which meant other code had to take them being uninitialized into consideration over and over at runtime. That code is hereby removed. This commit enables further simplifications to follow in later commits. Commit: d77036a76961e39488e9dc11e6fcdbabcaaea7eb https://github.com/Perl/perl5/commit/d77036a76961e39488e9dc11e6fcdbabcaaea7eb Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Use void_ macro form when ignoring return The void_ form panics if unsuccessful; and here we are relying on it being successful. Commit: c28569278c735a30ee4036b650e9856bdd5e4c89 https://github.com/Perl/perl5/commit/c28569278c735a30ee4036b650e9856bdd5e4c89 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Don't exclude LC_ALL in loop This function was setting each individual locale category to the same value. But if all the subcomponents are the same, so is LC_ALL. No need to special case it Commit: e632a1d4c5ec45737dbddf37d0ebada5b83aa83d https://github.com/Perl/perl5/commit/e632a1d4c5ec45737dbddf37d0ebada5b83aa83d Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M locale.c M proto.h Log Message: ----------- locale.c: Change function to return void It just returns the input value unchanged; this is a no-op. Commit: e1187293a454530b09008df751539b3b45cab504 https://github.com/Perl/perl5/commit/e1187293a454530b09008df751539b3b45cab504 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M perl.h M proto.h Log Message: ----------- locale.c: Remove no-longer needed parameter and computation When a locale category changes, LC_ALL necessarily also does. When we are looping changing a bunch of categories, LC_ALL's intermediate values are of no importance; only the final value matters. Prior to this commit, this was handled by setting a flag to not do the recalculation until the final loop iteration. But a more elegant solution is to not recalculate it all, until the value is actually needed. So the code is changed to invalidate the stored value if an individual locale category changes, and then do the calculation only when needed and invalidated. Commit: ec2cfcd341eaef4bfd970e1cce7dd27c7afc67e9 https://github.com/Perl/perl5/commit/ec2cfcd341eaef4bfd970e1cce7dd27c7afc67e9 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M locale.c M proto.h Log Message: ----------- locale.c: Change parameter name for static function category_locales_list is somewhat more descriptive than individ_locales Commit: 54a877d2b669534c8e79f3ec1c651ec26366f3c7 https://github.com/Perl/perl5/commit/54a877d2b669534c8e79f3ec1c651ec26366f3c7 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- locale.c: Change API of S_calculate_LC_ALL_string This function looks at all the individual locale categories on the system. So far it is called with either an array of the current values for them, or an object from which those values can be derived. But the object is always the current locale object in effect. The querylocale_i() macro can be used to get this information without needing to have to name the object. Therefore the object parameter is superfluous, and the function could be notified to use querylocale_i by making the array parameter NULL. But right now you get one or the other. There are two signatures to this function, depending on the platform capabilities. This commit collapses those into one signature, the one with an array parameter. And then NULL is used to trigger calling querylocale_i(). The reason to do this is that future commits will want to pass an array to this function, even when it is compiled on a platform that currently doesn't allow that option. Commit: af1c7cc605896326b1dc4f1caad9c06e13d64d52 https://github.com/Perl/perl5/commit/af1c7cc605896326b1dc4f1caad9c06e13d64d52 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Simplify S_get_LC_ALL_display The previous enhancements to calculate_LC_ALL_string means this function can just call it without having to loop itself. Commit: e073ab130af359375a247165873bc19adcc1439b https://github.com/Perl/perl5/commit/e073ab130af359375a247165873bc19adcc1439b Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Slight refactoring of S_querylocale_2008_i This just moves some asserts, adds comments and a branch prediction, and replaces a variable used in only one place by it value. Commit: d7f90ca784f6f16fac0b2c9281459aea84829b85 https://github.com/Perl/perl5/commit/d7f90ca784f6f16fac0b2c9281459aea84829b85 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Shortcut common case When using the POSIX 2008 locale interface, perl keeps (for the entire lifetime of the process) an object for when all locale categories are in the C locale. So, if someone queries the current locale, and the C object is the one in effect, the locale must be C, and we can return C immediately. This has the salubrious effect of hiding from perl bugs on some *BSD-related platforms. A link to a ticket to FREEBSD is in one of the comment lines of this commit. Commit: c70d158a28a8e6573a909a6ec9b8aa60877c8246 https://github.com/Perl/perl5/commit/c70d158a28a8e6573a909a6ec9b8aa60877c8246 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Reorder #if clauses Currently, the two clauses are about the same length, but in the next commit the current first clause will become a lot longer. The principal that it's easier to read code that disposes of the easy cases first comes into play, so, reverse the clause order. Commit: bd896a9853ca3b27599f1f40d9baef0c687eb8e0 https://github.com/Perl/perl5/commit/bd896a9853ca3b27599f1f40d9baef0c687eb8e0 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Inline only remaining use of querylocale_l() Future commits would make this macro need to be a function anyway, and since there is only one use of it, just inline it. The assertion it defines is no longer needed, as we know that the one place it is now placed is valid. This also adds explanatory comments Commit: 4024c8674cfb7d24e5e95e84cc1bf06f2e5e0c33 https://github.com/Perl/perl5/commit/4024c8674cfb7d24e5e95e84cc1bf06f2e5e0c33 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Flatten two nested if's These can be combined into a single more cohesive construct Commit: 08a4c3c587672448e64eb1b23a998c22c668032d https://github.com/Perl/perl5/commit/08a4c3c587672448e64eb1b23a998c22c668032d Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move a #define, and add a comment Commit: 40206d071a88df7dcb2dee8e472f12251a0881a5 https://github.com/Perl/perl5/commit/40206d071a88df7dcb2dee8e472f12251a0881a5 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- XXX try reverting: locale.c: Lock around querylocale See what passes Commit: 4f005c9055c6e024a8a7a7cf0e53173b1073f823 https://github.com/Perl/perl5/commit/4f005c9055c6e024a8a7a7cf0e53173b1073f823 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- Revert "XXX try reverting: locale.c: Lock around querylocale" This reverts commit 899565f1db40eb12fba5733b20cd63362d7e5b5f. Commit: 57cc1500c49bc2b14f8b037e8d392fa2249b83ed https://github.com/Perl/perl5/commit/57cc1500c49bc2b14f8b037e8d392fa2249b83ed Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M perl.h M proto.h Log Message: ----------- locale.c: Split up S_setlocale_from_aggregate_LC_ALL This splits out the parsing of the LC_ALL string from the locale setting. Future commits will use the parse portion in more places. The new code doesn't panic on syntax errors, unlike the old. This is because we should never panic on user input, but return failure instead. Commit: f73b04c9defecbe6b670e00b2308347960d67a8f https://github.com/Perl/perl5/commit/f73b04c9defecbe6b670e00b2308347960d67a8f Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Create is_disparate_LC_ALL() This macro uses the results of the new Configure probe that tells us how the platform represents disparate LC_ALL strings. Commit: c3ddc7807e9a8de189cf7ae30dfc792ca1ecde5d https://github.com/Perl/perl5/commit/c3ddc7807e9a8de189cf7ae30dfc792ca1ecde5d Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move two helper functions for POSIX 2008 implementation Commit: e3bf062097e82a66fc22d76c582f58c5b90afcf8 https://github.com/Perl/perl5/commit/e3bf062097e82a66fc22d76c582f58c5b90afcf8 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M perl.h M proto.h Log Message: ----------- Add development aid for simulating LC_ALL fake positional notation There are two ways that systems represent LC_ALL when not all individual categories are in the same locale. One is category_name=value pairs, and the other is a positional notation cat1_value|cat2_value|cat3_value|... where the separator (here '|') varies between platforms, and the position of a value determines which category it applies to. This commit adds the ability to simulate a positional box on a name=value box, so that many bugs can be found without having to access a real positional box. Commit: 8f0c83348e748a9c450c61867feab17d108ba974 https://github.com/Perl/perl5/commit/8f0c83348e748a9c450c61867feab17d108ba974 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Add support for LC_ALL positional notation Some platforms use a positional notatiol for LC_ALL when not all categories are the same, like C/English/C.UTF-8/ ... This commit takes advantage of the new Configure probe to now handle those when parsing an LC_ALL string. Commit: cde09d36f61616170000b2b9b7fd4d2d58ea7f70 https://github.com/Perl/perl5/commit/cde09d36f61616170000b2b9b7fd4d2d58ea7f70 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: use variable to avoid extra comparisons The mnemonic name also makes it clearer. Instead of comparing two variables multiple times, set a boolean once with the result, and use that. Commit: 7dd6072c9ace13f042a66e067d86558d6e42f850 https://github.com/Perl/perl5/commit/7dd6072c9ace13f042a66e067d86558d6e42f850 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Windows Use .ACP for sys default fallback Prior to this commit the locale handling code thought that Windows used "" for the system default locale. But it's not, and to get to the change in the initialization code, the "" had already been tried and failed. Commit: 71130c4d349ef13d031111f7aa697a2f53c7898e https://github.com/Perl/perl5/commit/71130c4d349ef13d031111f7aa697a2f53c7898e Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c M perl.h Log Message: ----------- locale.c, perl.h: comments, white space Commit: 2a9eff25accb1cee0a305032992e5383915d2617 https://github.com/Perl/perl5/commit/2a9eff25accb1cee0a305032992e5383915d2617 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- XXX maybe not for windows: S_calculate_LC_ALL_string(): save value after calculation On some platforms the string returned by this function also needs to be kept up-to-date in an array element. This commit changes the function to do the update (after the potentially expensive calculation) as a side-effect, so as to avoid unnecessary recalculations. Commit: dbce0e5232ba38d622608e8d885d1101662df160 https://github.com/Perl/perl5/commit/dbce0e5232ba38d622608e8d885d1101662df160 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Precalculate LC_ALL string boiler plate length When not all categories have the same locale, the internal representation of LC_ALL is a sequence of 'cat=value' pairs, separated by semi-colons. The only things that vary are the values. This commit sums up the non-varying portions at compile time. Commit: f21a20bd71ebcb701ec2ab23901610b38353f301 https://github.com/Perl/perl5/commit/f21a20bd71ebcb701ec2ab23901610b38353f301 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- S_querylocale_2008_i: Add caller's line# param This will be helpful in debugging Commit: 98175d838d16ee53f5f4786f8a395c3dc2e8b852 https://github.com/Perl/perl5/commit/98175d838d16ee53f5f4786f8a395c3dc2e8b852 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M perl.h M proto.h Log Message: ----------- locale.c: Calculate native LC_ALL strings There are two methods of representing non-uniform LC_ALL strings. One is name=value pairs, and the other is positional. Now that there is a Configure probe that detects the details, calculate_LC_ALL_string() is here enhanced to have a parameter passed to it as to which variety the output should be in, and to generate the proper format. Commit: 0e099527b376a570996baacead9826d15be84df3 https://github.com/Perl/perl5/commit/0e099527b376a570996baacead9826d15be84df3 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- locale.c: Revamp S_stdize_locale() We are now able to parse and construct non-uniform LC_ALL strings. A big part of this function was trying to deal with these, but now that can be farmed out. It's now extremely unlikely this function will now actually change anything, based on recent field experience. To save copying that therefore won't likely ever be needed, this function now returns its input if unchanged, and a mortalized copy if it unlikely does need to be changed. That means it no longer needs a buffer reserved for it. The input is going to be the static global buffer pointed to by the return of setlocale(). That means calls to this function need to be protected by mutexes in threaded systems, and the result safely copied during the critical section. This requirement is unchanged by this commit. Commit: 59cd77a80cfcac243d125f3e4eff15221fb2147c https://github.com/Perl/perl5/commit/59cd77a80cfcac243d125f3e4eff15221fb2147c Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embedvar.h M intrpvar.h M locale.c M makedef.pl M perl.c M sv.c Log Message: ----------- Rename the buffer in S_less_dicey_locale It was reusing the buffer formerly used by S_stdize_locale(), but now its only use is from this function, so name it accordingly. Commit: 8692fe3cf6bb93c5ce48b5a33dd5e40b30d72f2f https://github.com/Perl/perl5/commit/8692fe3cf6bb93c5ce48b5a33dd5e40b30d72f2f Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- S_stdize_locale() Rmv testing for spurious '=' This code had been added to counteract occasional cases of improper syntax in a locale string. Other fixes to the locale handling have resulted in those cases not now showing up. It was never clear if the changes that code made to the locale name were actually the right thing to do. Now, we have the ability to correctly parse locale strings on all platforms tested on. If there is a problem with a platform, the parsing discovers it and returns an error, which stdize_locale() checks for and also returns an error if found, and so on back up the line to the user calling code. Commit: a9bf31679639729c75a6a40a27649c694ecdd13b https://github.com/Perl/perl5/commit/a9bf31679639729c75a6a40a27649c694ecdd13b Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M hints/aix.sh M locale.c M proto.h Log Message: ----------- XXX perldelta other pod: Compile stdize_setlocale() only if requested XXX perldelta, and where else? This very old function has been whittled down to just looking for newlines in returned locales. Those just haven't come up in platforms we have tested on in recent years. Therefore, this is extra work on most, or perhaps all platforms. Should a platform show that this is still needed, its hints file can be changed to add a Configure option. Commit: e9e52f31ef5232e03778d41b4fa38ca4aa39d7d9 https://github.com/Perl/perl5/commit/e9e52f31ef5232e03778d41b4fa38ca4aa39d7d9 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- Properly handle broken setlocale(LC_ALL, NULL) Early AIX versions could return a truncated value in this case. https://www.ibm.com/support/pages/apar/IV22097 Tests were skipped as a result by 59b4d2932ceb16662879bca2a22315c3597276ae. This commit adds an easy workaround for this bug, changes the AIX hints page to enable it; the next commit will revert the test skipping. Commit: 460272328e6fe47e48a1a8000ac90a080ab21eb1 https://github.com/Perl/perl5/commit/460272328e6fe47e48a1a8000ac90a080ab21eb1 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M lib/locale.t M t/lib/warnings/regexec M t/run/locale.t Log Message: ----------- Revert "AIX: skip some locale tests" This reverts commit 59b4d2932ceb16662879bca2a22315c3597276ae. which was a temporary fix for 5.38.0. And now a workaround is in place for the defective libc implementation. Commit: 75c209cd228f18698a9dfaf4da8985c2e703d2fd https://github.com/Perl/perl5/commit/75c209cd228f18698a9dfaf4da8985c2e703d2fd Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Create STDIZED_SETLOCALE_LOCK Its best to use a mutex associated with the operation. This creates one for stdized_setlocale(), which is just an alias for another mutex. Commit: 1325000786e4bcd29c9bf93b5a47a8339432843c https://github.com/Perl/perl5/commit/1325000786e4bcd29c9bf93b5a47a8339432843c Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move a macro definition earlier in the file Commit: baffc0b5dbd2fd1236f4d1311beee71882477943 https://github.com/Perl/perl5/commit/baffc0b5dbd2fd1236f4d1311beee71882477943 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Change DEBUG statements to include non-0 errno This is very helpful when things go wrong. Commit: 2a8bb1b5ea447ad6c3f5df8d017ba2e3fdae9e24 https://github.com/Perl/perl5/commit/2a8bb1b5ea447ad6c3f5df8d017ba2e3fdae9e24 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Only define string constant on platforms that need it Commit: 9a171ce7a3ae13aad8ecc09a7653d155aba48605 https://github.com/Perl/perl5/commit/9a171ce7a3ae13aad8ecc09a7653d155aba48605 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- Perl_sync_locale(): Best to change to global locale This didn't actually cause a bug AFAIK, but prior to this commit, the comment was wrong. The comment makes sense, so bring the code into compliance. The reason it was not a bug is that even though the thread remained in the per-thread locale, it uses the global locale API to set things. Commit: 9d2038b96376959df2b64fdd029a8e8dc3f60d72 https://github.com/Perl/perl5/commit/9d2038b96376959df2b64fdd029a8e8dc3f60d72 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c(): Use LC_ALL if available Now that we have code that works on platforms with differing ways of representing LC_ALL, we can use it instead of looping through all the subcomponents. Commit: e7ddfd04accef48f68422602dee13e27d3f173b5 https://github.com/Perl/perl5/commit/e7ddfd04accef48f68422602dee13e27d3f173b5 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- locale.c: Extract code into a function This is in preparation for a future commit where it will be called from more than one place. Commit: a0add31c8779b97e952022299521c58e161b970b https://github.com/Perl/perl5/commit/a0add31c8779b97e952022299521c58e161b970b Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- locale.c: Extract code into separate function This is in preparation for it being called from a second location in a future commit. Beyond the move, the only changes are to white space, and a PERL_UNUSED_ARG. Commit: 9a6fd8fb20f5a82f4bbb5db22c3ade0835aed3fa https://github.com/Perl/perl5/commit/9a6fd8fb20f5a82f4bbb5db22c3ade0835aed3fa Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Complement initialization of boolean This was my attempt to make the difference listing in the next commit smaller, but it didn't help much. Commit: ce01fa8dec2d2602070e6f6115c610d77b34d149 https://github.com/Perl/perl5/commit/ce01fa8dec2d2602070e6f6115c610d77b34d149 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Rework locale initialization loop The previous code was always hard to understand, with a self-modifying loop. I finally figured out a clearer way to do it, by using an enum with all the possibilities, and a switch statement that sets up the loop for each, or decides this possibility isn't valid on this platform. The first possibility that works exits the loop. Commit: c48ae26aa743d5c200ca16005f01768dc326c579 https://github.com/Perl/perl5/commit/c48ae26aa743d5c200ca16005f01768dc326c579 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- f Commit: 48470d931d375620a36ce88316456f86b81201da https://github.com/Perl/perl5/commit/48470d931d375620a36ce88316456f86b81201da Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Rmv redundant sanity check This was done only on Windows, to verify that the perl was operating on a system that has a working _configthreadlocale(), when our Configure expects it to. But the previous commit now executes this function anyway at the endif of initialization, so that is soon enough to fail if something is wrong, making this redundant. Commit: d651dec4d0f4675286a4cc20f5290eec5575dd63 https://github.com/Perl/perl5/commit/d651dec4d0f4675286a4cc20f5290eec5575dd63 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M utf8.h Log Message: ----------- silence utf8.h warning Commit: 1234fc14f47c88572e614a8e845a94c6b824d461 https://github.com/Perl/perl5/commit/1234fc14f47c88572e614a8e845a94c6b824d461 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Extract code into a macro This is in preparation for a simplification in future commits. Commit: c14812e58028b9b21c725993ee7b657df359c9b3 https://github.com/Perl/perl5/commit/c14812e58028b9b21c725993ee7b657df359c9b3 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Extend macro from previous commit Actually this creates a macro of the same name that accomplishes the same thing, but specifically for Windows. Commit: 5f36e8f2253b6ac3e484aacd6af517cf35d32c4f https://github.com/Perl/perl5/commit/5f36e8f2253b6ac3e484aacd6af517cf35d32c4f Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Don't over allocate array This previously added an extraneous unused element. Commit: 17d9090b77822a2ad0f8bc3065463bbf7bd27ebe https://github.com/Perl/perl5/commit/17d9090b77822a2ad0f8bc3065463bbf7bd27ebe Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Bring declaration inside #if's This would now cause a compilation error if the code gets screwed up. Commit: c92038c6da32e97356f0ecb1694cb9b80e5ab980 https://github.com/Perl/perl5/commit/c92038c6da32e97356f0ecb1694cb9b80e5ab980 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Slight refactor of switch_to_global_locale() Now that we can better handle any legal LC_ALL string, we can just use LC_ALL when available. Commit: e4b560a1aa42abe65e02e9d87cb684d286aba444 https://github.com/Perl/perl5/commit/e4b560a1aa42abe65e02e9d87cb684d286aba444 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M proto.h M utf8.c Log Message: ----------- Perl__byte_dump_string(): Properly handle NULL input Instead of an assert, this returns (nil) and things can proceed. Commit: 8d0ecb603ff258f38f72877354bc08d7f1b85984 https://github.com/Perl/perl5/commit/8d0ecb603ff258f38f72877354bc08d7f1b85984 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Combine two condiionals to rm special case The case removed is handled transparently below. Commit: f08839b03c9bbfe92f0bde1f5bee028acf7f85f6 https://github.com/Perl/perl5/commit/f08839b03c9bbfe92f0bde1f5bee028acf7f85f6 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- S_find_locale_from_environment(): Change var name This variable is really the LANG environment variable; change its name to correspond. Commit: 40c563c19b05da3a5593655df98990e6f9995362 https://github.com/Perl/perl5/commit/40c563c19b05da3a5593655df98990e6f9995362 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- S_find_locale_from_environment(): Add comments Commit: 2a95e17c64d9151f149c062cb1dab4b7f87a5dc7 https://github.com/Perl/perl5/commit/2a95e17c64d9151f149c062cb1dab4b7f87a5dc7 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- S_find_locale_from_environment(): Combine logic Prior to this commit, the logic was repeated for non-LC_ALL versus LC_ALL; the latter being executed in a loop. The logic is not really trivial and it would be better to have just one instance, so that it can't get out-of-sync. To do this, this commit moves everything to the loop, but sets it up for the non-LC_ALL case to just do a single iteration. It also avoids going out to the environment and fetching LANG unless needed. The previous behavior got LANG unconditionally if the loop was used. It is quite likely that not every locale category would have a corresponding environment variable set, so that fetch likely wasn't wasted. But in order to combine things, the checking for LANG is done in the loop. The bottom line is that there is extra code required to combine the two pieces of logic, but I believe the combining of this into a single paradigm is worth it. Commit: 256e8ac0afdec847d82517f94855a2bd9e74b9a2 https://github.com/Perl/perl5/commit/256e8ac0afdec847d82517f94855a2bd9e74b9a2 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- XXX tests; linux doesn't allow this:S_find_locale_from_environment: Handle disparate LC_ALL Prior to this commit, it was possible on some platforms to improperly set a locale category from a locale of "". Consider: export LC_ALL="LC_CTYPE=de_DE;LC_NUMERIC=C;LC_TIME=de_DE;..." and in Perl run with that environment: print POSIX::setlocale(LC_NUMERIC, ""); Commit: 09d95914cd0d2b68a112ad65837dd89dc95376a3 https://github.com/Perl/perl5/commit/09d95914cd0d2b68a112ad65837dd89dc95376a3 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M locale.c M proto.h Log Message: ----------- Change parameter name for S_bool_setlocale_2008_i THe new name is more descriptive Commit: dc36c1aa3f9980ba89dbbd6c9bd492cb8bed2114 https://github.com/Perl/perl5/commit/dc36c1aa3f9980ba89dbbd6c9bd492cb8bed2114 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- S_bool_setlocale_2008_i: Improve debug statements Commit: 7284a2dbaf0482757f50a3f41381d5b0ff69fe2a https://github.com/Perl/perl5/commit/7284a2dbaf0482757f50a3f41381d5b0ff69fe2a Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- S_bool_setlocale_2008_i: Check for failure return Previously, this would forge ahead; looking at the code it seems it would fail later on anyway, but it is best to check and fail immediately. Commit: 5b5f167911fe13ceabae2e93fc76829c92bdbe98 https://github.com/Perl/perl5/commit/5b5f167911fe13ceabae2e93fc76829c92bdbe98 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- S_bool_setlocale_2008_i: Separate out failure code This causes the failure to be handled by going to effectively a tail-call spot. This is in preparation for it being used in another place. Commit: ef296b787aadd82c9fe695fc150243655f021dc4 https://github.com/Perl/perl5/commit/ef296b787aadd82c9fe695fc150243655f021dc4 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move declaration closer to first use Commit: fe8e00e08199d579638ad97feaf9f2a7005cf5fd https://github.com/Perl/perl5/commit/fe8e00e08199d579638ad97feaf9f2a7005cf5fd Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Extract two debug statements into macros This is in preparation for them being called from other places Commit: 42174a8189c28b027750447e6ff4157549c8afe4 https://github.com/Perl/perl5/commit/42174a8189c28b027750447e6ff4157549c8afe4 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Indent/outdent some lines This is to make the differences in the next commit smaller Commit: d95297406ddba367e7af40fabd1be5ce14d8f583 https://github.com/Perl/perl5/commit/d95297406ddba367e7af40fabd1be5ce14d8f583 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Rmv obsolete code A "" input locale has been expanded by the time it gets here, so this is never true; it is a relict from previous implementations. Commit: 334f5ec81a5982089d6204dab06cf6b32541b186 https://github.com/Perl/perl5/commit/334f5ec81a5982089d6204dab06cf6b32541b186 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- S_bool_setlocale_2008_i: Copy function call. This removes a function call from a single place and inserts it in several. The reason is that it makes a future commit cleaner. Commit: b2eeeecb25ef5130af122c506c3fa9d42dd98c67 https://github.com/Perl/perl5/commit/b2eeeecb25ef5130af122c506c3fa9d42dd98c67 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Combine debugging lines This information is a subset of a debug statement just prior to it. Commit: 17a66a3c3213dbbe94cac8f6024a6ce05f0f83ed https://github.com/Perl/perl5/commit/17a66a3c3213dbbe94cac8f6024a6ce05f0f83ed Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- S_update_PL_curlocales(): Add parameter This is the ultimate caller's line number, which will be useful in a future commit; unused for now. Commit: 51b6ac8d9343b53aaeeda353838e7328b54f831e https://github.com/Perl/perl5/commit/51b6ac8d9343b53aaeeda353838e7328b54f831e Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- S_update_PL_curlocales_i(): Reverse order of conditionals The new ordering will play better with future commits Commit: 7e6a1ea9309805008e656543ae087c5769dd78a9 https://github.com/Perl/perl5/commit/7e6a1ea9309805008e656543ae087c5769dd78a9 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c M perl.h Log Message: ----------- locale.c: Update comments, white-space in 2 functions Commit: bed363b2a74845996d083e17d7ece7ed9ea3f9b6 https://github.com/Perl/perl5/commit/bed363b2a74845996d083e17d7ece7ed9ea3f9b6 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Avoid an (unlikely) leak As the comments say, this eventuality is unlikely to happen, but if it did, it would mean a leak. Commit: 35c7104f8da31c6f59daa35c21b739c26afc7142 https://github.com/Perl/perl5/commit/35c7104f8da31c6f59daa35c21b739c26afc7142 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- S_bool_setlocale_2008_i: Remove recursion This converts recursive calls of this function into an iterative loop. Besides the obvious benefits, some platforms don't even require a loop, as a future commit will do. Commit: 49591e3dd199e4a7e7f8583a5e891d4614294e45 https://github.com/Perl/perl5/commit/49591e3dd199e4a7e7f8583a5e891d4614294e45 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- Rmv unused function: S_setlocale_from_aggregate_LC_ALL Previous commits have removed all uses of this Commit: 20c1f54192f6fb04f5ef3d87d136fe3760d42311 https://github.com/Perl/perl5/commit/20c1f54192f6fb04f5ef3d87d136fe3760d42311 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M perl.h M proto.h Log Message: ----------- S_parse_LC_ALL_string: Squash if categories are same locale It turns out that some platforms return something like C/C/C/C/C/C instead of just the equivalent 'C' when querying LC_ALL. This can lead to extra work for us, and unnecessary noise when displayed to the user. This commit changes parse_LC_ALL_string() to look for this case, and to coalesce the result to just the single value, which is returned in just the 0th element of the input array, leaving the other elements unused. It makes this behavior overridable by an input flag, which will be used in a future commit. Commit: 52b4d89eb277e67e57204baff5b35c1de6f8ccd9 https://github.com/Perl/perl5/commit/52b4d89eb277e67e57204baff5b35c1de6f8ccd9 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- S_update_PL_curlocales(): accept arbitrary LC_ALL string Prior to this commit, this function couldn't handle an LC_ALL string that wasn't just a single locale for all categories. But now that we can parse a disparate string, update this function to use that. Commit: 60046e59749137c60412852ec7ca6ad94e2a3896 https://github.com/Perl/perl5/commit/60046e59749137c60412852ec7ca6ad94e2a3896 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- S_setlocale_2008_i(): Use single newlocale() if available On some platforms the newlocale() libc function when setting LC_ALL can handle an input locale that sets some categories to one thing; and others to another; etc. On such platforms, we don't have to loop through all categories individually. This commit changes to use that if the #define indicating its availability is set. Commit: 7fafa2ba335350c0058408e90c1820a22f5c96a1 https://github.com/Perl/perl5/commit/7fafa2ba335350c0058408e90c1820a22f5c96a1 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embedvar.h M intrpvar.h M locale.c M makedef.pl M perl.c M sv.c Log Message: ----------- XXX Partial need vutil.c first Rmv underlying numeric This object, only on POSIX 2008 systems, is no longer used. I've been keeping it around in case I could figure out if it had any remaining utility, but don't see any. Commit: dc9fb1983bfee234200437ccba7d5a2b2fc61ee9 https://github.com/Perl/perl5/commit/dc9fb1983bfee234200437ccba7d5a2b2fc61ee9 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Use function already designed for the purpose Instead of several initialization calls, call the overarching one that includes them all. Commit: fb86167a919ba19b08c8c968fdfdd6808901d04c https://github.com/Perl/perl5/commit/fb86167a919ba19b08c8c968fdfdd6808901d04c Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Avoid a duplicate conditional Commit: 44b2f409f263d975041f534270e4cb2833b18cc4 https://github.com/Perl/perl5/commit/44b2f409f263d975041f534270e4cb2833b18cc4 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Initialize PL_cur_locale_obj Commit: 0067b8a015ce0b59f5ffedbdd26acc2fb5dd09d3 https://github.com/Perl/perl5/commit/0067b8a015ce0b59f5ffedbdd26acc2fb5dd09d3 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- XXX Initial guess as to newlocale() capability glibc has a newlocale() that can handle disparate LC_ALL string input. This commit is until more data is gathered. Commit: 23a7047d1c1b8f4273b64e01b3df3aca76dea4b3 https://github.com/Perl/perl5/commit/23a7047d1c1b8f4273b64e01b3df3aca76dea4b3 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M perl.h M proto.h Log Message: ----------- Add caller location info to e.g. RESTORE_LC_NUMERIC These help pinpointing the error source when a failure occurs. Commit: f215ad87e89d0fcce050e6f7440c50e51c372feb https://github.com/Perl/perl5/commit/f215ad87e89d0fcce050e6f7440c50e51c372feb Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- XXX tests,delta: Handle glibc extra locale categories glibc has several locale categories not found in standards. This commit provides minimal support. Commit: 54373471cbd2ea074089ab9c3e87c1d792b278ee https://github.com/Perl/perl5/commit/54373471cbd2ea074089ab9c3e87c1d792b278ee Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M perl.h M proto.h Log Message: ----------- Properly handle ignored locale categories perl can be compiled to ignore arbitrary locale categories that are actually on the system. This has never worked transparently, especially on platforms that use postional notation to represent LC_ALL when not all categories are set to the same locale. The system calls will return a string containing the ignored category, and we dont know how to handle that. This large commit fixes that by compiling to include the information about all categories on the system. But if a category is to be ignored, instead we set it to the C locale, and thwart any effort to change it away from that locale. Commit: 4012637b0c6971ed561125edce160bda5e871262 https://github.com/Perl/perl5/commit/4012637b0c6971ed561125edce160bda5e871262 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- Revise warnings when locale init has issues Previously, we didn't know the possible locale categories on this system, so grepped through the environment outputting anything that begins with 'LC_'. But now we do know all of them, and can just use those. Commit: 85850eca365485d833db832880ca25467b7e3823 https://github.com/Perl/perl5/commit/85850eca365485d833db832880ca25467b7e3823 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- S_calculate_LC_ALL_string: Add parameter This parameter is set only when this function is being called by Perl_setlocale(). This is purely for performance It causes this function to use a particular buffer and avoid extra copying. Commit: 05477020c389c29d89cded212f5c70153c8d7fd8 https://github.com/Perl/perl5/commit/05477020c389c29d89cded212f5c70153c8d7fd8 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- XXX why not failing tests before this?Create S_native_querylocale_i() and use it This new function differs from the already existing plain querylocale_i() in that it returns in the platform's native format, instead of the internal=to-perl one. The internal one is used generally so that code doesn't have to cope with multiple possible formats. The format of the new locale in Perl_setlocale() is going to be in native format. We effectively translate it into our internal one at the input edge, and that is used thereafter. But until this commit, the translation back to native format at the output edge was incomplete. This mostly worked because native format differs from locale.c internal format in just two ways. One is the locale for LC_NUMERIC. perl keeps it generally in the C locale, except for brief intervals which higher level code specifies, when the real locale is swapped in. (Actually, this isn't quite true. If the real locale is indistinguishable from C as far as LC_NUMERIC goes, perl is happy to use it rather than C, so as to save swapping.) locale.c had the code in it to translate the internal format back to native, so it worked for this case. The other is LC_ALL when not all categories are set to the same locale. Windows and Linux use 'name=value;' pairs notation, while things derived from BSD (and others) use a positional notation in which only the values are given, and the system knows which category a given value is for from its position in the string. Perl worked fine for the name=value pairs notation, because that is the same as its internal one, so no translation got done, but until this commit, there were issues on positional platforms. This seldom got in the way since most people, if they set the locale at all, will just set it to some single 'foo'. What this commit effectively does is change Perl_setlocale() to return the value in the native format which the libc functions are expecting. This differs from what it used to return only on platforms which use the positional notation and only for LC_ALL when not all categories are set to the same locale. The new function subsumes much of the work previously done in Perl_setlocale(), and it is able to simplify some of that work. Commit: 6ece65399a3148c3a78e6dc14295380a47654866 https://github.com/Perl/perl5/commit/6ece65399a3148c3a78e6dc14295380a47654866 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- f after testing Commit: bc65ee835a023ed1657c642bfe0ef8ea6544c25b https://github.com/Perl/perl5/commit/bc65ee835a023ed1657c642bfe0ef8ea6544c25b Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Remove no longer used macro Commit: c00fc9eb45752dbac78bd79735d38eb73e8f6c8a https://github.com/Perl/perl5/commit/c00fc9eb45752dbac78bd79735d38eb73e8f6c8a Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- Add setlocale_i() This macro is defined on Configurations where a simple unadorned setlocale works for categories that don't have perl record keeping involved. This allows Perl_setlocale() to avoid a lot of unnecessary overhead for these. This commit defines it only for unthreaded perls. Commit: 080f143886138331f1a412af64124d394b060f0e https://github.com/Perl/perl5/commit/080f143886138331f1a412af64124d394b060f0e Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move S_update_PL_curlocales() Prior to this commit, it was only for POSIX 2008, but a future commit will want to use it when not POSIX 2008. Commit: 659dc95b498dd0f8b73978bacdc8551e56de6849 https://github.com/Perl/perl5/commit/659dc95b498dd0f8b73978bacdc8551e56de6849 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- savepv if threaded, unused I think Commit: 873bcc500c275840ef547ee6877d27382ee0bfd8 https://github.com/Perl/perl5/commit/873bcc500c275840ef547ee6877d27382ee0bfd8 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Rmv unexecuted statement after croak Commit: dd62d0e200ad72e82c73c9b2958b24bb3def35dd https://github.com/Perl/perl5/commit/dd62d0e200ad72e82c73c9b2958b24bb3def35dd Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Improve collation debugging output This adds a special case for when the buffer is empty Commit: 28d47c5932f4d594906f09c934c45d0d00b67b89 https://github.com/Perl/perl5/commit/28d47c5932f4d594906f09c934c45d0d00b67b89 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- XXX introductory file comments Commit: ee769a0f98ec3d6c48bfde6912ec213d2e310eab https://github.com/Perl/perl5/commit/ee769a0f98ec3d6c48bfde6912ec213d2e310eab Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Only compile workaround on platforms needing it This code works around a bug on Windows with regard to localeconv(). And the bug only exists on such platforms that have thread-safety. Prior to this commit, the code was compiled on platforms lacking thread-safety, so was unnecessary. Commit: a132e24c7f3436e8b2a24c407c56dfc309b80a53 https://github.com/Perl/perl5/commit/a132e24c7f3436e8b2a24c407c56dfc309b80a53 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M intrpvar.h M locale.c Log Message: ----------- locale.c: Use wider than U32 for a counter Processes that change locales are incrementing a counter that could eventully wrap if the process is long-lived. It's not likely, but it's also easy to make this a U64 if available, and make the chances of it happening much closer to zero. Commit: 251b9fcd0a39311d5a041af40140b2dcdc35c93b https://github.com/Perl/perl5/commit/251b9fcd0a39311d5a041af40140b2dcdc35c93b Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move setting errno out of critical section I doesn't matter much, but its better practice to make critical sections as small as possible. Commit: 2cdfb06fd3e5788ee445884ac43d432e70348b17 https://github.com/Perl/perl5/commit/2cdfb06fd3e5788ee445884ac43d432e70348b17 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- get_win32_message_utf8ness() Fix unlikely case This function calls get_locale_string_utf8ness_i(). The API of that function changed earlier in the 5.37 series, and this was not updated to correspond. It is calling it with category 0, wich it thinks is an out-of-bounds value, but it really is LC_ALL on Windows. Thus it actually probably doesn't lead to a failure, but it theoretically could fail if LC_ALL is not uniform. So it's better to not succeed just by accident. This commit changes to now use LC_CTYPE as the category. And if someone has managed to compile Windows without LC_CTYPE, it now just says that the input string isn't UTF-8, as without LC_CTYPE, you've only got the C locale. Commit: a59d2032ac1abca80ad09229cb6c2111137c30ec https://github.com/Perl/perl5/commit/a59d2032ac1abca80ad09229cb6c2111137c30ec Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Only define a structure if needed Without LC_NUMERIC, this structure is unused, and generates a compiler warning. Commit: de50b3f045b7c42f8552717a06eaabea030165da https://github.com/Perl/perl5/commit/de50b3f045b7c42f8552717a06eaabea030165da Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Add a debugging statement This can be helpful in tracing what's happening with nl_langinfo() calls. Commit: 66792a0e77f29871eaf7ad674cce37ceeb0d5360 https://github.com/Perl/perl5/commit/66792a0e77f29871eaf7ad674cce37ceeb0d5360 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- perlapi: Improve wording for Perl_langinfo() Commit: b50f004d2bb4b9955a27cdb032ca35b7928afced https://github.com/Perl/perl5/commit/b50f004d2bb4b9955a27cdb032ca35b7928afced Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Critical section around initializing a global This code should only have a race in the unlikely event that it is an embedded perl, and there is another perl already running. But best to avoid the possibility at all. Commit: 1d96a96cbee3adc0d91deb42a22a8c2dc214ea18 https://github.com/Perl/perl5/commit/1d96a96cbee3adc0d91deb42a22a8c2dc214ea18 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move #ifdef DEBUGGING This moves it up to precede a block that only does debugging info. Commit: c25ee550662f8fd9f1c37e7a6666b76b6afb5ec2 https://github.com/Perl/perl5/commit/c25ee550662f8fd9f1c37e7a6666b76b6afb5ec2 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- S_stdize_locale: Set errno if fails Commit: 759c7595c906e336e398850cb0725ed9dc1e11e7 https://github.com/Perl/perl5/commit/759c7595c906e336e398850cb0725ed9dc1e11e7 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- XXX experimental: Define setlocale_i() on unsafe threaded builds On threaded Configurations where thread-safe locale handling is not available, perl automatically does a modicum of prevention of races by executing locale changes in a critical section, and copying the results to a thread-safe location. This commit defines setlocale_i() on such builds. This macro is used to bypass more complex handling required in fully thread-safe builds. I don't see how this changes thread-safeness on the unsafe builds, and it passes the tests, but I'm considering it experimental for now, until later in the development cycle. Commit: 73a9f0e002a3d8da930b81ee97cdca49affbeac4 https://github.com/Perl/perl5/commit/73a9f0e002a3d8da930b81ee97cdca49affbeac4 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M t/porting/bincompat.t Log Message: ----------- skip bincompat.t Commit: 91406f31737bf038b872c80c94af7962db957807 https://github.com/Perl/perl5/commit/91406f31737bf038b872c80c94af7962db957807 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M hints/darwin.sh Log Message: ----------- darwin hints querylocale race in earlier darwins? Commit: 8f3cde37007d938f2e1a4e81753a7c00c29ac21c https://github.com/Perl/perl5/commit/8f3cde37007d938f2e1a4e81753a7c00c29ac21c Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: make querylocale locking conditional Commit: 38626fdb54adfe7760e66bb2388ba884ad0d5181 https://github.com/Perl/perl5/commit/38626fdb54adfe7760e66bb2388ba884ad0d5181 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M intrpvar.h Log Message: ----------- intrpvar.h: Comments Commit: 4bb516ff8bec4ddbfc407f3f5f1a9b97eb797340 https://github.com/Perl/perl5/commit/4bb516ff8bec4ddbfc407f3f5f1a9b97eb797340 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M embedvar.h M handy.h M inline.h M intrpvar.h M locale.c M makedef.pl M mg.c M perl.c M perl.h M proto.h M sv.c Log Message: ----------- emul Commit: 6950e97bd3bcb680286d3b6c2a428eee5bd33a73 https://github.com/Perl/perl5/commit/6950e97bd3bcb680286d3b6c2a428eee5bd33a73 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- f emul Commit: 1c5d298b8994a56dd18e01cebbe73ee865281dfb https://github.com/Perl/perl5/commit/1c5d298b8994a56dd18e01cebbe73ee865281dfb Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M locale.c M proto.h Log Message: ----------- locale.c: Change to use enum type Instead of 'unsigned int', use the more restricted enum. Commit: 1de1b8cc19de7d39c712a826a65fa2fad3e45d14 https://github.com/Perl/perl5/commit/1de1b8cc19de7d39c712a826a65fa2fad3e45d14 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- locale.c: Compile utf8ness on platforms that need it These two functions need to be compiled on certain other platforms than what was happening. Commit: 27311629ab1820c36c4484b6d50a5e9ae540821b https://github.com/Perl/perl5/commit/27311629ab1820c36c4484b6d50a5e9ae540821b Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Silence compiler warning on some platforms This argument isn't used on some platforms. Commit: 1138fcd821ace79f0e613585a6fb2895b6e10cb3 https://github.com/Perl/perl5/commit/1138fcd821ace79f0e613585a6fb2895b6e10cb3 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M Configure M locale.c M metaconfig.h M perl.h Log Message: ----------- f Configure Commit: 69b9328f705477cac602ac38b1a5a7ea9a2cb9ef https://github.com/Perl/perl5/commit/69b9328f705477cac602ac38b1a5a7ea9a2cb9ef Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M Configure M locale.c M metaconfig.h M perl.h Log Message: ----------- Revert "f Configure" This reverts commit 12d2cfd3fbf933bbbfb52a448d8bdda62f7ac100. Commit: 26aedec49f501b412c316755cdd7cfc5bcb8f4f5 https://github.com/Perl/perl5/commit/26aedec49f501b412c316755cdd7cfc5bcb8f4f5 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M makedef.pl Log Message: ----------- drop when Configure fixed Commit: ec59081e461bf7da2ab31d006c1d6353bde293b1 https://github.com/Perl/perl5/commit/ec59081e461bf7da2ab31d006c1d6353bde293b1 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M makedef.pl Log Message: ----------- makedef.pl: PL_cur_locale_obj is only POSIX 2008 multiplicity Commit: a0f8380baf20d7f87e7dbaed2abf24b2792a8993 https://github.com/Perl/perl5/commit/a0f8380baf20d7f87e7dbaed2abf24b2792a8993 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M makedef.pl Log Message: ----------- makedef.pl: Move comment Commit: de94e5f8889476e8353a42704cf136736b9c429b https://github.com/Perl/perl5/commit/de94e5f8889476e8353a42704cf136736b9c429b Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M makedef.pl Log Message: ----------- Maybe drop: makedef.pl: Move code Commit: b5f1496be1e41df6c42523a9867aa2fabf38a601 https://github.com/Perl/perl5/commit/b5f1496be1e41df6c42523a9867aa2fabf38a601 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M makedef.pl Log Message: ----------- makedef.pl: Remove obsolete symbol Commit: 0c60bd64813d657092b0d91229492cc83da7dda8 https://github.com/Perl/perl5/commit/0c60bd64813d657092b0d91229492cc83da7dda8 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M perl.h Log Message: ----------- Add DEBUG_SETLOCALE_INCONSISTENCIES Commit: aa129fc3dc77bd12a48b2be2ad80b685aff2df29 https://github.com/Perl/perl5/commit/aa129fc3dc77bd12a48b2be2ad80b685aff2df29 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M perl.h Log Message: ----------- Fix mingw locale builds Experience has shown that mingw with an older runtime library doesn't have more modern Windows features working properly. This commit causes it to compile with workarounds, but allows the user to -Accflags='-DUCRT_USED' to indicate to Configure that the code will be using the modern CRT. Commit: 08dea4e4d2192c75b9d0551b228ea1d5ea354ce9 https://github.com/Perl/perl5/commit/08dea4e4d2192c75b9d0551b228ea1d5ea354ce9 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M perl.h Log Message: ----------- Enable DEBUG_SETLOCALE_INCONSISTENCIES Commit: e7df19613f35b1a2924de65ef0b6fd18a5edd418 https://github.com/Perl/perl5/commit/e7df19613f35b1a2924de65ef0b6fd18a5edd418 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M perl.h Log Message: ----------- perl.h: Add detail to locale mutex debug Commit: 69aef0583670e111b60e20a14973392df011549b https://github.com/Perl/perl5/commit/69aef0583670e111b60e20a14973392df011549b Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c M perl.h Log Message: ----------- XXX remaining loose ends Commit: 1c78618e94dc667188c83f94977e16f1f24ed931 https://github.com/Perl/perl5/commit/1c78618e94dc667188c83f94977e16f1f24ed931 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M cpan/version/t/07locale.t M pod/perlembed.pod M t/porting/customized.dat Log Message: ----------- final commit Commit: fc053744d53830afb539d3eb4fa86cb61d77b062 https://github.com/Perl/perl5/commit/fc053744d53830afb539d3eb4fa86cb61d77b062 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- use enum, maybe drop Commit: 79531526bbad39d86bb02be2eb6f18001a10fbd5 https://github.com/Perl/perl5/commit/79531526bbad39d86bb02be2eb6f18001a10fbd5 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- Revert "prev commit" This reverts commit 4be10ec67fb8fef94cb573a8f7b51cb23610517f. Commit: 027f4264330620ade739ccf8b0f0cdb37ff18773 https://github.com/Perl/perl5/commit/027f4264330620ade739ccf8b0f0cdb37ff18773 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M locale.c M proto.h Log Message: ----------- more cat index enum Commit: e3a31e4bcf6e984f70cc38e07e0431931e657d6e https://github.com/Perl/perl5/commit/e3a31e4bcf6e984f70cc38e07e0431931e657d6e Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M dist/Tie-File/t/29a_upcopy.t Log Message: ----------- XXX temp: dist/Tie-File/t/29a_upcopy.t: Up alarm Commit: e2f5ea0d6ae1e898e692a23662f4a021fb4e8a4a https://github.com/Perl/perl5/commit/e2f5ea0d6ae1e898e692a23662f4a021fb4e8a4a Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M perl.h Log Message: ----------- f Commit: 77edeb1627b47642f238d2c674bb601bf0e2e5a1 https://github.com/Perl/perl5/commit/77edeb1627b47642f238d2c674bb601bf0e2e5a1 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M perl.h Log Message: ----------- perl.h fixup Commit: 86b2980d4d9e136bd2ec1f15ae3fd025a6542e84 https://github.com/Perl/perl5/commit/86b2980d4d9e136bd2ec1f15ae3fd025a6542e84 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M Configure Log Message: ----------- f Configure for positional Commit: 4cf1e5bce3383b76f5bc4c9e4299243e05002bb8 https://github.com/Perl/perl5/commit/4cf1e5bce3383b76f5bc4c9e4299243e05002bb8 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- fixup init for C C C C C Commit: e749adc75d74b5f382c907e3671bc3ff73373b54 https://github.com/Perl/perl5/commit/e749adc75d74b5f382c907e3671bc3ff73373b54 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- perlapi: Fix strftime inaccuracies, clarify Commit: 3b8ac68a4c2e7c1add2298c2980e194ab8eb5322 https://github.com/Perl/perl5/commit/3b8ac68a4c2e7c1add2298c2980e194ab8eb5322 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- Set errno when my_strftime() fails. The libc strftime() doesn't have any way to distinguish between erroneous input and that which just doesn't generate any output; hence it doesn't set errno. But my_strftime() has logic to reasonably confidently make that distinction, so it should set errno when it determines that it is erroneous input. Commit: 812c71c959f3340eb44747a441cc9a4c9a8e667e https://github.com/Perl/perl5/commit/812c71c959f3340eb44747a441cc9a4c9a8e667e Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- add is_cur_locale_utf8 Commit: ab40fedc8e60cbe158e4e2e41cbe8b94a206ba5c https://github.com/Perl/perl5/commit/ab40fedc8e60cbe158e4e2e41cbe8b94a206ba5c Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Simplify S_new_ctype By creating a temporary variable, an else is eliminated, and the lock/unlock are brought close together. Commit: 2a500d0a15fe294e5910929ee441e1e6c84c66be https://github.com/Perl/perl5/commit/2a500d0a15fe294e5910929ee441e1e6c84c66be Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M dist/threads/threads.xs M embed.fnc M locale.c M perl.h M proto.h M util.c M win32/win32thread.c Log Message: ----------- switch_locale_context: Add aTHX This fixes GH #21040 Instead of a dTHX, this passes aTHX automatically, and skips calling this function if there is no valid context. It moves that decision into the macro itself, avoiding some #ifdef directives. And it adds explanation f Commit: c3dad1fafbcafd9a4cf3c1595fa08895ce3aec12 https://github.com/Perl/perl5/commit/c3dad1fafbcafd9a4cf3c1595fa08895ce3aec12 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- strftime: Always restore LC_CTYPE locale my_strftime toggles LC_CTYPE to match LC_TIME to avoid mojibake. In reading the code, I realized that there was a code path that doesn't properly restore it, namely when failure is returned. This commit fixes that. Commit: b026a391e7532a1964ff3c4ea424531084830479 https://github.com/Perl/perl5/commit/b026a391e7532a1964ff3c4ea424531084830479 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M cpan/Time-Piece/Piece.xs Log Message: ----------- Time::Piece: Use reentrant API This single line magically makes this work much better under threading, though critical section locks need to be added as well. Commit: 9281d1d6661848faedcd3728a3f9e6be65bf9b91 https://github.com/Perl/perl5/commit/9281d1d6661848faedcd3728a3f9e6be65bf9b91 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M cpan/Time-Piece/Piece.xs Log Message: ----------- Time-Piece: Use foldEQ_locale() if available This supported core function is thread-safe and knows about Perl internals, so is preferable to the similar libc function, which is now used only as a fallback. This commit also bomb proofs the code by adding an additional fallback, specified in C89, which isn't a great substituted, but far better than nothing. Commit: 02852dcf6fad76e53d6e7cbb97cf07eaeb868149 https://github.com/Perl/perl5/commit/02852dcf6fad76e53d6e7cbb97cf07eaeb868149 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M cpan/Time-Piece/Piece.xs Log Message: ----------- Time-Piece: Use isSPACE_LC, not isspace; etc isDIGIT_LC() does the same thing as isdigit when everything goes well, but is more robust when things get more complicated. The _LC forms are thread safe, for example. But note that this code doesn't work properly for a UTF-8 locale, as it assumes that a byte and character are the same thing. A major overhaul would be needed to handle that. Commit: 5c839400bb3a184729a96b296e3be54c03d21b04 https://github.com/Perl/perl5/commit/5c839400bb3a184729a96b296e3be54c03d21b04 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Don't compile unreachable code This code is attempting to compute the nl_langinfo() codeset of the current locale. If there is no LC_CTYPE available on the system, the codeset must be 'C', and the only callers to this static function know that, and return that answer without calling this function. That means this part of the function will never be executed. So don't compile it. Commit: ca6460f737c6cf5acf2ceb7f7fdd4858c0e3f258 https://github.com/Perl/perl5/commit/ca6460f737c6cf5acf2ceb7f7fdd4858c0e3f258 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embedvar.h M intrpvar.h M locale.c M makedef.pl Log Message: ----------- locale.c: Prevent infinite recursion This could happen on the very rare platform that isn't Windows, nor supports nl_langinfo(), and has a buggy (or non-existent) mbtowc(). The code implements nl_langinfo() itself by recursion, and for some locales could end up recursing indefinitely. This commit adds guards to prevent that. Commit: f9f0eb04c95f9c6f3a847bc34ddf72267c1edba8 https://github.com/Perl/perl5/commit/f9f0eb04c95f9c6f3a847bc34ddf72267c1edba8 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M perl.h Log Message: ----------- perl.h: Add DISABLE_LC_NUMERIC_CHANGES macro This is for code that needs to keep other code from changing LC_NUMERIC out from under it, but avoids the knowledge of PL_numeric_standard, which is used when perl controls the locale handling. This is designed for 'version' (vutil.c) to use, because it has to operate seamlessly in the mode where perl controls the handling, and when it doesn't, even if it doesn't know it doesn't. Commit: 62760d18850ea31c9e9a17c437458164c376ee5a https://github.com/Perl/perl5/commit/62760d18850ea31c9e9a17c437458164c376ee5a Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M perl.h Log Message: ----------- perl.h: Remove extraneous ';' Commit: ece5b61ba55703c00b52eeccad6c56d10a564183 https://github.com/Perl/perl5/commit/ece5b61ba55703c00b52eeccad6c56d10a564183 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M dist/threads/threads.xs Log Message: ----------- XXX threads.xs: Move #ifdef to beginning of file XXX saves an interior ifdef, but unsure if worth it. Commit: 667f52c56f7636652eb4cd3c003354f1701f4b12 https://github.com/Perl/perl5/commit/667f52c56f7636652eb4cd3c003354f1701f4b12 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M perl.h Log Message: ----------- perl.h: localeconv() isn't broken on Windows unthreaded Nor is it broken if compiled without per-thread locale handling. The bug in it until VS 2015 was that it always looked at the global locale. When the only locale available is the global one, there is not breakage. This commit thus avoids compiling workaround code for the bug when it isn't necessary. Commit: 34cb54b0c37ad7a4ae234926831275f7a07301cc https://github.com/Perl/perl5/commit/34cb54b0c37ad7a4ae234926831275f7a07301cc Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M thread.h Log Message: ----------- thread.h: White space only Indent some nested preproccessor defines Commit: a12cb8da402faed4f9c933db36babef008c9bafd https://github.com/Perl/perl5/commit/a12cb8da402faed4f9c933db36babef008c9bafd Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M win32/Makefile Log Message: ----------- win32 perl mem log Commit: 1e4affe3dab04bbafc4ff85c9f2a6889e5aef2b7 https://github.com/Perl/perl5/commit/1e4affe3dab04bbafc4ff85c9f2a6889e5aef2b7 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M ext/POSIX/t/time.t Log Message: ----------- time.t Commit: 9e6f5d8ad336a907bc2972e50aa8ae1b99bdb8e5 https://github.com/Perl/perl5/commit/9e6f5d8ad336a907bc2972e50aa8ae1b99bdb8e5 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M ext/POSIX/t/time.t Log Message: ----------- POSIX/t/time.t: Remove no longer necessary code POSIX::strftime() now automatically handles the case where the locales of LC_TIME and LC_CTYPE aren't the same. So no need to explicitly do this in the test file. Commit: 597492d35e02fed0345736213a4f4e6f786bb51d https://github.com/Perl/perl5/commit/597492d35e02fed0345736213a4f4e6f786bb51d Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M ext/POSIX/t/time.t Log Message: ----------- XXX see how affects earlier commits: time.t: Add more strftime tests Commit: cead59eb0d48a01c9e706c9445ade7f9cf1a40e3 https://github.com/Perl/perl5/commit/cead59eb0d48a01c9e706c9445ade7f9cf1a40e3 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- locale.c: Split my_strftime into 2 functions Future commits will want the individual functionality the two provided separately. Commit: c026bd7a96e96c46642af0204f38dcbc87280d0c https://github.com/Perl/perl5/commit/c026bd7a96e96c46642af0204f38dcbc87280d0c Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move my_strftime() within the file This will be more logically placed after future commits Commit: 50251b75f916ffdeaabae20a04c830a4e488bb56 https://github.com/Perl/perl5/commit/50251b75f916ffdeaabae20a04c830a4e488bb56 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M ext/POSIX/POSIX.xs M locale.c M proto.h Log Message: ----------- Implement sv_strftime_tm and sv_strftime_ints These two functions are designed to free the caller from having to know anything about the intricacies of handling UTF-8 in using strftime(), as they take SV inputs and return an SV with the UTF-8 flag appropriately set. They differ only in that one takes a bunch of integer arguments that define the various components of the time; and the other takes a pointer to a struct tm. The POSIX implementation of strftime is converted to use these. Commit: 30eb6eab91d96f25f5d7cdbfcf14fc6350c080d8 https://github.com/Perl/perl5/commit/30eb6eab91d96f25f5d7cdbfcf14fc6350c080d8 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M cpan/Time-Piece/Piece.pm M cpan/Time-Piece/Piece.xs M cpan/Time-Piece/Seconds.pm M dist/Module-CoreList/lib/Module/CoreList.pm Log Message: ----------- Time::Piece: Add critical sections This calls various macros to make certain libc calls uninterruptible, so that they can be used safely in threaded applications, when this module is loaded with a perl that supports this. The macros are defined to do nothing if the perl doesn't contain working versions of them. In such perls, the macros are also defined to do nothing except on configurations that could have races. Typically, an extra problem is that the libc calls return in a global static buffer, subject to being overwritten by another thread. But an earlier commit defined PERL_REENTRANT, which makes those functions transparently return in a thread-local buffer instead. That doesn't help if the function gets interrupted by another thread; this commit completes the process. Commit: 12db046f7fc8894769d1869d9c76bee4a0feaf1f https://github.com/Perl/perl5/commit/12db046f7fc8894769d1869d9c76bee4a0feaf1f Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M cpan/Time-Piece/Piece.xs Log Message: ----------- Implement sv_strftime_tm and sv_strftime_ints These two functions are designed to free the caller from having to know anything about the intricacies of handling UTF-8 in using strftime(), as they take SV inputs and return an SV with the UTF-8 flag appropriately set. They differ only in that one takes a bunch of integer arguments that define the various components of the time; and the other takes a pointer to a struct tm. The POSIX implementation of strftime is converted to use these. Commit: db03cbd4bc3091985695b78b83b224218fc972ed https://github.com/Perl/perl5/commit/db03cbd4bc3091985695b78b83b224218fc972ed Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- S_get_locale_string_utf8ness_i: Fix return If the input is NULL, the utf8ness of the string isn't NO, but actually, IMMATERIAL, as there is nothing there that matters Commit: 503819e85146e9b4aad32e4a7e1d53f2e024b9d1 https://github.com/Perl/perl5/commit/503819e85146e9b4aad32e4a7e1d53f2e024b9d1 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Avoid work that would be thrown away If the caller to this function doesn't care about the UTF-8ness of the result, no need to calculate it. Commit: 0ac4272f4af735d525899c31e6af189e1f0d06b4 https://github.com/Perl/perl5/commit/0ac4272f4af735d525899c31e6af189e1f0d06b4 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M intrpvar.h M locale.c M makedef.pl M sv.c M util.c Log Message: ----------- Attempts to fix windows free pool panic Commit: 657177e14f41be008203df9f61bb7148e7d08c37 https://github.com/Perl/perl5/commit/657177e14f41be008203df9f61bb7148e7d08c37 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M cpan/Time-Piece/Piece.xs Log Message: ----------- Time-Piece: notes to myself Commit: 105cb03c6c74c1b6a7951e90aa379de542129f50 https://github.com/Perl/perl5/commit/105cb03c6c74c1b6a7951e90aa379de542129f50 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M locale.c Log Message: ----------- dregs Commit: 7fd25e6d2256b47c70237227c6ea73ce464e8290 https://github.com/Perl/perl5/commit/7fd25e6d2256b47c70237227c6ea73ce464e8290 Author: Karl Williamson <k...@cpan.org> Date: 2023-05-21 (Sun, 21 May 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h M t/loc_tools.pl Log Message: ----------- l Compare: https://github.com/Perl/perl5/compare/eca1ad5d248c...7fd25e6d2256