summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-01-22 02:00:42 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2016-01-25 18:15:44 +0100
commit074564d40c21cb063bf327e9151a4e24cd9534b5 (patch)
tree68a12653bd3f9cc57d74d74ede08c5d9b05fcfb1
parent529bf9b00dfd3c0472d77e9515007e52a3557bc4 (diff)
use consistently the last : as name:arch separator
Proper debian packages do not contain ':' in the package name, so for real packages this is a non-issue, but apt itself frequently makes use of packages with such an illegal name for internal proposes. Git-Dch: Ignore
-rw-r--r--apt-pkg/pkgcache.cc2
-rw-r--r--apt-pkg/pkgcachegen.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index d2ecb8b1f..d6dd169bb 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -263,7 +263,7 @@ pkgCache::PkgIterator pkgCache::FindPkg(const string &Name) {
}
pkgCache::PkgIterator pkgCache::FindPkg(StringView Name) {
- auto const found = Name.find(':');
+ auto const found = Name.rfind(':');
if (found == string::npos)
return FindPkg(Name, "native");
auto const Arch = Name.substr(found+1);
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index 6e307fba9..0dbac3df8 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -659,7 +659,7 @@ bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg, StringView Name,
// lazy-create foo (of amd64) provides foo:amd64 at the time we first need it
if (Arch == "any")
{
- size_t const found = Name.find(':');
+ size_t const found = Name.rfind(':');
StringView ArchA = Name.substr(found + 1);
if (ArchA != "any")
{