locale-util: filter out non-UTF-8 locales even when failed to parse $SYSTEMD_LIST_NON_UTF8_LOCALES
This commit is contained in:
@@ -220,7 +220,10 @@ int get_locales(char ***ret) {
|
||||
locales = set_free(locales);
|
||||
|
||||
r = getenv_bool("SYSTEMD_LIST_NON_UTF8_LOCALES");
|
||||
if (IN_SET(r, -ENXIO, 0)) {
|
||||
if (r <= 0) {
|
||||
if (!IN_SET(r, -ENXIO, 0))
|
||||
log_debug_errno(r, "Failed to parse $SYSTEMD_LIST_NON_UTF8_LOCALES as boolean, ignoring: %m");
|
||||
|
||||
char **a, **b;
|
||||
|
||||
/* Filter out non-UTF-8 locales, because it's 2019, by default */
|
||||
@@ -234,9 +237,7 @@ int get_locales(char ***ret) {
|
||||
}
|
||||
|
||||
*b = NULL;
|
||||
|
||||
} else if (r < 0)
|
||||
log_debug_errno(r, "Failed to parse $SYSTEMD_LIST_NON_UTF8_LOCALES as boolean");
|
||||
}
|
||||
|
||||
strv_sort(l);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user