fix crash when LANGUAGE is not set
authorMichael Vogt <mvo@debian.org>
Thu, 18 Feb 2010 21:08:25 +0000 (22:08 +0100)
committerMichael Vogt <mvo@debian.org>
Thu, 18 Feb 2010 21:08:25 +0000 (22:08 +0100)
apt-pkg/aptconfiguration.cc
debian/changelog

index b5f2947..10613f1 100644 (file)
@@ -217,7 +217,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
index 558fd8b..ca731d1 100644 (file)
@@ -1,3 +1,9 @@
+apt (0.7.26~exp2) experimental; urgency=low
+
+  * fix crash when LANGUAGE is not set
+
+ -- Michael Vogt <mvo@debian.org>  Thu, 18 Feb 2010 22:07:23 +0100
+
 apt (0.7.26~exp1) experimental; urgency=low
 
   [ David Kalnischkies ]