Skip to content

Commit

Permalink
Properly handle ignored locale categories
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
khwilliamson committed May 6, 2023
1 parent fedf826 commit 3fc6bd0
Show file tree
Hide file tree
Showing 5 changed files with 650 additions and 105 deletions.
1 change: 1 addition & 0 deletions embed.fnc
Expand Up @@ -4397,6 +4397,7 @@ S |void |give_perl_locale_control \
S |parse_LC_ALL_string_return|parse_LC_ALL_string \
|NN const char *string \
|NN const char **output \
|const parse_LC_ALL_STRING_action \
|bool always_use_full_array \
|const bool panic_on_error \
|const line_t caller_line
Expand Down
2 changes: 1 addition & 1 deletion embed.h
Expand Up @@ -1286,7 +1286,7 @@
# endif
# if defined(LC_ALL)
# define give_perl_locale_control(a,b) S_give_perl_locale_control(aTHX_ a,b)
# define parse_LC_ALL_string(a,b,c,d,e) S_parse_LC_ALL_string(aTHX_ a,b,c,d,e)
# define parse_LC_ALL_string(a,b,c,d,e,f) S_parse_LC_ALL_string(aTHX_ a,b,c,d,e,f)
# else
# define give_perl_locale_control(a,b) S_give_perl_locale_control(aTHX_ a,b)
# endif
Expand Down

0 comments on commit 3fc6bd0

Please sign in to comment.