From 9422895d4ee53aa31e775ced5d8bda1d7be23df3 Mon Sep 17 00:00:00 2001 From: Matthias Klumpp Date: Tue, 22 Feb 2022 23:43:30 +0100 Subject: [PATCH] trivial: aptcc: Fix up the previous patch I accidentally cherry-picked the wrong patch from the wrong branch before, this change fixes the previous mistakes. Sorry! Resolves: #534 --- backends/aptcc/apt-cache-file.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/backends/aptcc/apt-cache-file.cpp b/backends/aptcc/apt-cache-file.cpp index 41e37761a..0c011fa1c 100644 --- a/backends/aptcc/apt-cache-file.cpp +++ b/backends/aptcc/apt-cache-file.cpp @@ -380,17 +380,16 @@ PkgInfo AptCacheFile::resolvePkgID(const gchar *packageId) strcmp(ver.VerStr(), parts[PK_PACKAGE_ID_VERSION]) == 0) return PkgInfo(ver, piAction); - const pkgCache::VerIterator &candidateVer = findCandidateVer(pkg); // check to see if the provided package isn't virtual too // also iterate through all the available versions - auto candidate = candidateVer; + auto candidateVer = findCandidateVer(pkg); while (true) { if (strcmp(candidateVer.VerStr(), parts[PK_PACKAGE_ID_VERSION]) == 0) return PkgInfo(candidateVer, piAction); - if (!candidate.end()) + if (candidateVer.end()) break; - candidate++; + candidateVer++; }; return PkgInfo(ver, piAction);