Skip to content

Fix locale handling in Solaris #23199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,7 @@ Vlad Harchev <[email protected]>
Vladimir Alexiev <[email protected]>
Vladimir Marek <[email protected]>
Vladimir Timofeev <[email protected]>
Vladimír Marek <[email protected]>
Volker Schatz <[email protected]>
vsfos <[email protected]>
W. Geoffrey Rommel <[email protected]>
Expand Down
10 changes: 10 additions & 0 deletions locale.c
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,16 @@ S_parse_LC_ALL_string(pTHX_ const char * string,

Size_t index; /* Our internal index for the current category */
const char * s = string;

/* Solaris setlocale(3C) returns composite locale prefixed by slash. For example
* "/en_US.UTF-8/C/C/C/C/C". See man page. We must remove it or this
* function will think that there is additional empty locale at the
* beginning of the string and the number of detected locales will not
* match expected LC_ALL_INDEX_. */
if (strnEQ(s, separator, separator_len)) {
s += separator_len;
}

const char * e = s + strlen(string);
const char * category_end = NULL;
const char * saved_first = NULL;
Expand Down
Loading