]> Savannah Git Hosting - gnulib.git/commit
setlocale: Improve fallback on macOS.
authorBruno Haible <bruno@clisp.org>
Mon, 20 May 2019 19:25:01 +0000 (21:25 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 20 May 2019 19:25:01 +0000 (21:25 +0200)
commit661c55d6c287e1e6122e0ec03668ec859b6d806a
tree0874da1bf36711800e2069afccc9aca779e3e8a7
parentbf5935a7c870a4aef806cc5aa41f938b2929fdcb
setlocale: Improve fallback on macOS.

* lib/setlocale.c (search): Optimize away a redundant strcmp()
invocation.
(locales_with_principal_territory): New array.
(langcmp, get_main_locale_with_same_language): New functions.
(locales_with_principal_language): New array.
(terrcmp, get_main_locale_with_same_territory): New functions.
(rpl_setlocale): When setlocale_single failed, try again with a locale
that is more likely to exist. Don't warn if the environment variable
SETLOCALE_VERBOSE is not set.
ChangeLog
lib/setlocale.c