From a100bb98eac562817ebb3139b82259cf0222cc2b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 18 Feb 2010 22:08:25 +0100 Subject: fix crash when LANGUAGE is not set --- apt-pkg/aptconfiguration.cc | 3 ++- debian/changelog | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index b5f29472d..10613f11d 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -217,7 +217,8 @@ 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,':'); short addedLangs = 0; // add a maximum of 3 fallbacks from the environment diff --git a/debian/changelog b/debian/changelog index 558fd8b10..ca731d11b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +apt (0.7.26~exp2) experimental; urgency=low + + * fix crash when LANGUAGE is not set + + -- Michael Vogt Thu, 18 Feb 2010 22:07:23 +0100 + apt (0.7.26~exp1) experimental; urgency=low [ David Kalnischkies ] -- cgit v1.2.3