diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2010-10-26 23:24:41 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2010-10-26 23:24:41 +0200 |
commit | 4b625b95a04a9d73c6682a3f9354112a394bb674 (patch) | |
tree | 6a5a427af607553ad03770d5a5089967e387f8c5 /apt-pkg | |
parent | 1c493315c5b1ba13cc68df85ba02fa06b13ad001 (diff) |
* apt-pkg/pkgcache.cc:
- fallback always to a suitable description (Closes: #601016)
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/pkgcache.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 324445fa7..616d400a2 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -891,18 +891,19 @@ pkgCache::DescIterator pkgCache::VerIterator::TranslatedDescription() const for (std::vector<string>::const_iterator l = lang.begin(); l != lang.end(); l++) { - pkgCache::DescIterator DescDefault = DescriptionList(); - pkgCache::DescIterator Desc = DescDefault; - - for (; Desc.end() == false; Desc++) + pkgCache::DescIterator Desc = DescriptionList(); + for (; Desc.end() == false; ++Desc) if (*l == Desc.LanguageCode() || (*l == "en" && strcmp(Desc.LanguageCode(),"") == 0)) break; - if (Desc.end() == true) - Desc = DescDefault; + if (Desc.end() == true) + continue; return Desc; } - + for (pkgCache::DescIterator Desc = DescriptionList(); + Desc.end() == false; ++Desc) + if (strcmp(Desc.LanguageCode(), "") == 0) + return Desc; return DescriptionList(); }; |