diff --git a/src/system/libroot/posix/locale/LocaleInternal.cpp b/src/system/libroot/posix/locale/LocaleInternal.cpp index 16d5aafd9b..6557133819 100644 --- a/src/system/libroot/posix/locale/LocaleInternal.cpp +++ b/src/system/libroot/posix/locale/LocaleInternal.cpp @@ -49,6 +49,7 @@ GetLocalesFromEnvironment(int category, const char** locales) to = LC_LAST; } else from = to = category; + bool haveDifferentLocales = false; locale = NULL; for (int lc = from; lc <= to; lc++) { @@ -62,7 +63,7 @@ GetLocalesFromEnvironment(int category, const char** locales) if (lastLocale != NULL && strcasecmp(locale, lastLocale) != 0) haveDifferentLocales = true; } - if (!haveDifferentLocales) { + if (from == 1 && to == LC_LAST && !haveDifferentLocales) { // we can set all locales at once locales[LC_ALL] = locale; }