X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/1a31359bfe4fdbf9ac1a25ab0b9f013d37099ac4..583f7c147dc479bbdb431aa94c4d589d785207c3:/apt-pkg/aptconfiguration.cc diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index 429219cbd..2acf8dd9f 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -152,6 +152,7 @@ std::vector const Configuration::getLanguages(bool const &All, builtin.push_back(c); } } + closedir(D); // get the environment language codes: LC_MESSAGES (and later LANGUAGE) // we extract both, a long and a short code and then we will @@ -217,9 +218,10 @@ std::vector const Configuration::getLanguages(bool const &All, environment.push_back(envLong); environment.push_back(envShort); // take care of LANGUAGE - string envLang = Locale == 0 ? getenv("LANGUAGE") : *(Locale+1); + const char *language_env = getenv("LANGUAGE") == 0 ? "" : getenv("LANGUAGE"); + string envLang = Locale == 0 ? language_env : *(Locale+1); if (envLang.empty() == false) { - std::vector env = ExplodeString(envLang,':'); + std::vector env = VectorizeString(envLang,':'); short addedLangs = 0; // add a maximum of 3 fallbacks from the environment for (std::vector::const_iterator e = env.begin(); e != env.end() && addedLangs < 3; ++e) {