diff options
author | Michael Vogt <mvo@debian.org> | 2010-02-18 22:08:25 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2010-02-18 22:08:25 +0100 |
commit | a100bb98eac562817ebb3139b82259cf0222cc2b (patch) | |
tree | da926330d2d32419c22dfcf3666ae5327f0860f3 /apt-pkg | |
parent | 0fd68707605f42741574304e5d51582fe298a4b0 (diff) |
fix crash when LANGUAGE is not set
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/aptconfiguration.cc | 3 |
1 files changed, 2 insertions, 1 deletions
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<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 |