summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-01-23 15:37:59 +0100
committerJulian Andres Klode <jak@debian.org>2016-01-23 15:40:17 +0100
commit8ee09b58e9f061cf5296c54680e2b3386f83ff04 (patch)
treeb98b91f5e6b4ae5cf03d48dd76bb112888e3d037 /apt-pkg/pkgcachegen.cc
parent7dd0c2eb45874d3df9a9ee2034501659548a1b97 (diff)
Remap another (non-parameter) StringView
I only looked at parameters in the previous commit, which was not enough: One place also generated local string views. In this case, we only need to make ArchA dynamic, as NameA is not used after the FindPkg() call. Gbp-Dch: ignore
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r--apt-pkg/pkgcachegen.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index d8f161e6d..55d1ee89d 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -661,10 +661,12 @@ bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg, StringView Name,
{
size_t const found = Name.find(':');
StringView const NameA = Name.substr(0, found);
- StringView const ArchA = Name.substr(found + 1);
+ StringView ArchA = Name.substr(found + 1);
pkgCache::PkgIterator PkgA = Cache.FindPkg(NameA, ArchA);
if (PkgA.end() == false)
{
+ // ArchA is used inside the loop which might remap (NameA is not used)
+ Dynamic<StringView> DynArchA(ArchA);
Dynamic<pkgCache::PkgIterator> DynPkgA(PkgA);
pkgCache::PrvIterator Prv = PkgA.ProvidesList();
for (; Prv.end() == false; ++Prv)