mirror of
https://github.com/systemd/systemd
synced 2024-10-15 04:24:19 +00:00
locale-util: check if enumerated locales are valid
This commit is contained in:
parent
065058e63b
commit
a2f7937747
|
@ -203,6 +203,15 @@ int get_locales(char ***ret) {
|
|||
if (r < 0)
|
||||
return r;
|
||||
|
||||
char *locale;
|
||||
SET_FOREACH(locale, locales) {
|
||||
r = locale_is_installed(locale);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r == 0)
|
||||
free(set_remove(locales, locale));
|
||||
}
|
||||
|
||||
l = set_get_strv(locales);
|
||||
if (!l)
|
||||
return -ENOMEM;
|
||||
|
|
Loading…
Reference in a new issue