Sfoglia il codice sorgente

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
Julian Andres Klode 10 anni fa
parent
commit
8ee09b58e9
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      apt-pkg/pkgcachegen.cc

+ 3 - 1
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)