Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 4ab43d2fda7a50fe8b61230a3da8682d73b82a1a
      
https://github.com/Perl/perl5/commit/4ab43d2fda7a50fe8b61230a3da8682d73b82a1a
  Author: Karl Williamson <k...@cpan.org>
  Date:   2022-09-02 (Fri, 02 Sep 2022)

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

  Log Message:
  -----------
  Define print_bytes_for_locale() outside locale

A future commit will need this even when locales are not used.


  Commit: 091b5ed71023c9935af36a68a005e67aaef5fde8
      
https://github.com/Perl/perl5/commit/091b5ed71023c9935af36a68a005e67aaef5fde8
  Author: Karl Williamson <k...@cpan.org>
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Refactor #ifdef's for clarity

The my_strerror() function has effectively 5 different implementations
depending on the capabilities of the platform.  Only a few lines are
common to all, the set-up and the return.  The #ifdefs obscure the
underlying logic.  So this commit separates things out so that the
ifdefs don't interrupt the flow as much, with the result that it's
clearer what is going on in each implementation.


  Commit: cb5c690da676cf4043cf4ff7c29cb6db6bdb1634
      
https://github.com/Perl/perl5/commit/cb5c690da676cf4043cf4ff7c29cb6db6bdb1634
  Author: Karl Williamson <k...@cpan.org>
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  Avoid mojibake in "$!"

In stress testing, I discovered that the LC_CTYPE and LC_MESSAGES
locales need to be the same locale, or strerror() can return
question marks or mojibake instead of the proper message.

This commit refactors the handling of stringifying "$!" to make the
locales of both categories the same during the stringification.

Actually, I suspect it isn't the locale, but the codeset of the locale
that needs to be the same.  I suspect that if the categories were both
in different UTF-8 locales, or both in single-byte locales, that things
would work fine.  But it's cheaper to find the locale rather than the
locale's codeset, so that is what is done.


  Commit: c728a1a6206bcd35a013b6b78f60bdc1adf5bfa2
      
https://github.com/Perl/perl5/commit/c728a1a6206bcd35a013b6b78f60bdc1adf5bfa2
  Author: Karl Williamson <k...@cpan.org>
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
    M embed.fnc
    M embed.h
    M locale.c
    M makedef.pl
    M mg.c
    M proto.h

  Log Message:
  -----------
  Move utf8ness calc for $! into locale.c from mg.c

locale.c has the infrastructure to handle this, so remove repeated
logic.

The removed code tried to discern better based on using script runs, but
this actually doesn't help, so is removed.

Since we're now using C99, we can remove the block that was previously
needed, and now the code is properly indented, whereas before it wasn't


  Commit: 8fffab5814a1dec668cc4056a4a6e0a06b0309f1
      
https://github.com/Perl/perl5/commit/8fffab5814a1dec668cc4056a4a6e0a06b0309f1
  Author: Karl Williamson <k...@cpan.org>
  Date:   2022-09-02 (Fri, 02 Sep 2022)

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

  Log Message:
  -----------
  locale.c: Add const to my_strerror retrurn

A bit of safety


  Commit: 3d118badf8a1b8d6cfcb6bf98a51ff62b0b0379a
      
https://github.com/Perl/perl5/commit/3d118badf8a1b8d6cfcb6bf98a51ff62b0b0379a
  Author: Karl Williamson <k...@cpan.org>
  Date:   2022-09-02 (Fri, 02 Sep 2022)

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

  Log Message:
  -----------
  locale.c: Rmv no longer used code; UTF8ness cache

What these functions do has been subsumed by code introduced in previous
commits, and in a more straight forward manner.

Also removed in this commit is the cache of the knowing what locales are
UTF-8 or not.  This data is now cheaper to calculate when needed, and
there is now a single entry cache, so I don't think the complexity
warrants keeping it.

It could be added back if necessary, split off from the remainder of
this commit.


  Commit: 8544fe162d08b4ee03c9249ae2e4bdee667b0056
      
https://github.com/Perl/perl5/commit/8544fe162d08b4ee03c9249ae2e4bdee667b0056
  Author: Karl Williamson <k...@cpan.org>
  Date:   2022-09-02 (Fri, 02 Sep 2022)

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

  Log Message:
  -----------
  locale.c: Convert final use of S_category_name()

The previous commit removed all but one use of this function, which is
replaceable by an array lookup


  Commit: 69bc7167fa24b1e8d3f810ce465d84bdddf413f6
      
https://github.com/Perl/perl5/commit/69bc7167fa24b1e8d3f810ce465d84bdddf413f6
  Author: Karl Williamson <k...@cpan.org>
  Date:   2022-09-02 (Fri, 02 Sep 2022)

  Changed paths:
    M embed.fnc
    M embed.h
    M embedvar.h
    M intrpvar.h
    M locale.c
    M makedef.pl
    M mg.c
    M proto.h
    M sv.c

  Log Message:
  -----------
  Merge branch 'Locale changes for "$!"' into blead

This series of commits improves the handling of system error messages
that come from strerror().

It turns out that strerror() can return mojibake if the LC_CTYPE locale
and the LC_MESSAGES locale aren't set to the same thing. They are now
synced for the duration of the routine, if necessary.

There have long been lots of preprocessor conditionals depending on the
platform's capabilities. These are now refactored so that the various
implementations are separate short functions, which are easier to
understand when not interrupted by those directives.

These commits and previous ones have now completely replaced some large
and cumbersome functions, which are also removed in this series.


Compare: https://github.com/Perl/perl5/compare/501e249dd393...69bc7167fa24

Reply via email to