>From 81ab5823ae00390d6a85dee0fb0a2492403451bb Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 23 Sep 2026 19:18:57 -0400 Subject: [PATCH 21/23] add a default locale path and switch to new environment variable the first component /etc/musl/locale is intended as a point of configuration to point a symlink at a host-specific or integration-specific location. the others provide a default so that configuration is not mandatory on a system using a canonical FHS-compatible location. the name of the environment variable to override the search path has been changed so that it does not conflict with using old binaries using the old gettext-style locale files. --- src/locale/locale_map.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locale/locale_map.c b/src/locale/locale_map.c index 5462572b..04dcdcaf 100644 --- a/src/locale/locale_map.c +++ b/src/locale/locale_map.c @@ -89,8 +89,8 @@ const struct __locale_map *__get_locale(int cat, const char *val) for (p=loc_head; p; p=p->next) if (!strcmp(val, p->name)) return p; - if (!libc.secure) path = getenv("MUSL_LOCPATH"); - /* FIXME: add a default path? */ + if (!libc.secure) path = getenv("MUSL_LOCALE_PATH"); + if (!path) path = "/etc/musl/locale:/usr/share/musl/locale:/share/musl/locale"; if (path) for (; *path; path=z+!!*z) { z = __strchrnul(path, ':'); -- 2.21.0