summaryrefslogtreecommitdiff
path: root/apt-pkg/aptconfiguration.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-10-05 22:45:22 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-10-05 22:45:22 +0200
commit7cb28948317e0d326c8663ec3c9ce995d5bf65e8 (patch)
tree42df84085ed6eaa11a035ae731a6ee545e2687ea /apt-pkg/aptconfiguration.cc
parent0fffbc8ce4cb6357f59db63db5571f46a668a66b (diff)
* apt-pkg/deb/debmetaindex.cc:
- none is a separator, not a language: no need for Index (Closes: #624218) * apt-pkg/aptconfiguration.cc: - do not builtin languages only if none is forced (Closes: #643787)
Diffstat (limited to 'apt-pkg/aptconfiguration.cc')
-rw-r--r--apt-pkg/aptconfiguration.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc
index a0566e05e..7441b452c 100644
--- a/apt-pkg/aptconfiguration.cc
+++ b/apt-pkg/aptconfiguration.cc
@@ -142,7 +142,7 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
for (struct dirent *Ent = readdir(D); Ent != 0; Ent = readdir(D)) {
string const name = Ent->d_name;
size_t const foundDash = name.rfind("-");
- size_t const foundUnderscore = name.rfind("_");
+ size_t const foundUnderscore = name.rfind("_", foundDash);
if (foundDash == string::npos || foundUnderscore == string::npos ||
foundDash <= foundUnderscore ||
name.substr(foundUnderscore+1, foundDash-(foundUnderscore+1)) != "Translation")
@@ -153,7 +153,7 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
// Skip unusual files, like backups or that alike
string::const_iterator s = c.begin();
for (;s != c.end(); ++s) {
- if (isalpha(*s) == 0)
+ if (isalpha(*s) == 0 && *s != '_')
break;
}
if (s != c.end())
@@ -234,6 +234,8 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
codes = environment;
} else if (forceLang != "none")
codes.push_back(forceLang);
+ else //if (forceLang == "none")
+ builtin.clear();
allCodes = codes;
for (std::vector<string>::const_iterator b = builtin.begin();
b != builtin.end(); ++b)