]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/aptconfiguration.cc
* apt-pkg/deb/dpkgpm.cc:
[apt.git] / apt-pkg / aptconfiguration.cc
index b5f29472d556460ad55464f882d21f72ac0d4dcc..f3f94dce3a6dc9760cbeb7709fa97f6c4b5a807c 100644 (file)
@@ -152,6 +152,7 @@ std::vector<std::string> 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,7 +218,8 @@ std::vector<std::string> 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<string> env = ExplodeString(envLang,':');
                short addedLangs = 0; // add a maximum of 3 fallbacks from the environment