Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 90617bb7a7865ac4be9a5b1381ca19ecc619ede7
      
https://github.com/Perl/perl5/commit/90617bb7a7865ac4be9a5b1381ca19ecc619ede7
  Author: Karl Williamson <k...@cpan.org>
  Date:   2023-09-11 (Mon, 11 Sep 2023)

  Changed paths:
    M embed.fnc
    M intrpvar.h
    M locale.c
    M proto.h

  Log Message:
  -----------
  Make PL_setlocale_buf and PL_langinfo_buf non-const

Having them const required some casting away of const.
Also applies to PL_less_dicey_locale_buf


  Commit: c227fc4aa68671b55fe71476bf13490db705cf1a
      
https://github.com/Perl/perl5/commit/c227fc4aa68671b55fe71476bf13490db705cf1a
  Author: Karl Williamson <k...@cpan.org>
  Date:   2023-09-11 (Mon, 11 Sep 2023)

  Changed paths:
    M embed.fnc
    M embed.h
    M locale.c
    M proto.h

  Log Message:
  -----------
  Split S_save_to_buffer into two

It creates a new, separately callable, function
'set_save_buffer_min_size'  to be used to make sure the buffer is at
least a given size.

save_to_buffer() now calls that new function instead of doing the
resizing itself.


  Commit: 18d80193786508f494574a42438eef10193d5ac3
      
https://github.com/Perl/perl5/commit/18d80193786508f494574a42438eef10193d5ac3
  Author: Karl Williamson <k...@cpan.org>
  Date:   2023-09-11 (Mon, 11 Sep 2023)

  Changed paths:
    M embed.fnc
    M embed.h
    M locale.c
    M proto.h

  Log Message:
  -----------
  new_LC_ALL: Make parameter meaningful

Prior to this commit, the parameter to this function was unused, and
existed only so that it could be in a table of function pointers all
having the same signature.

The parameter in the rest of them is the new locale that is being
changed to.  It was assumed that this function would just query the
existing locale, which should have been already set up by the time this
function gets called.

But that assumption will be made wrong shortly.  There will be a segment
of code in Perl_setlocale() where things aren't fully updated when this
function gets called.

Therefore change to pay attention to the parameter, which has always
been the correct value anyway.

To be more precise, before this commit, this function called
querylocale() which is expecting things to already be set up; and things
won't necessarily be fully set up, so avoid that call by using the
parameter.


  Commit: c272bab8725194f8ed25081791068a81e82f2f5b
      
https://github.com/Perl/perl5/commit/c272bab8725194f8ed25081791068a81e82f2f5b
  Author: Karl Williamson <k...@cpan.org>
  Date:   2023-09-11 (Mon, 11 Sep 2023)

  Changed paths:
    M embed.fnc
    M embed.h
    M locale.c
    M perl.h
    M proto.h

  Log Message:
  -----------
  S_calculate_LC_ALL_string: Add parameter

This parameter tells whether the return value is desired or not,
presenting some optimization possibilities.


  Commit: 85692818a17efd96ed6f61f9c552d8dec3e259be
      
https://github.com/Perl/perl5/commit/85692818a17efd96ed6f61f9c552d8dec3e259be
  Author: Karl Williamson <k...@cpan.org>
  Date:   2023-09-11 (Mon, 11 Sep 2023)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Get rid of a casting-away-const instance

Previously this was used to defeat constness in populating a string.  A
slight refactoring removes that need.


  Commit: 5ba25c116c8573b68a6103113d3b831e46f55bee
      
https://github.com/Perl/perl5/commit/5ba25c116c8573b68a6103113d3b831e46f55bee
  Author: Karl Williamson <k...@cpan.org>
  Date:   2023-09-11 (Mon, 11 Sep 2023)

  Changed paths:
    M embed.fnc
    M embed.h
    M locale.c
    M perl.h
    M proto.h

  Log Message:
  -----------
  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.  However, 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 LC_ALL 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: 2f7afdcea1f165ebaa4338c8c01ac0db1a7fa3ad
      
https://github.com/Perl/perl5/commit/2f7afdcea1f165ebaa4338c8c01ac0db1a7fa3ad
  Author: Karl Williamson <k...@cpan.org>
  Date:   2023-09-11 (Mon, 11 Sep 2023)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Remove no longer used macro


Compare: https://github.com/Perl/perl5/compare/4e6e60eea000...2f7afdcea1f1

Reply via email to