From 8ee09b58e9f061cf5296c54680e2b3386f83ff04 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 23 Jan 2016 15:37:59 +0100 Subject: 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 --- apt-pkg/pkgcachegen.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apt-pkg/pkgcachegen.cc') 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 DynArchA(ArchA); Dynamic DynPkgA(PkgA); pkgCache::PrvIterator Prv = PkgA.ProvidesList(); for (; Prv.end() == false; ++Prv) -- cgit v1.2.3