summaryrefslogtreecommitdiff
path: root/cmdline/apt-mark.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-02-11 18:54:48 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-02-11 18:54:48 +0100
commit5eb9a474dca2f48a935c234357c3adc9b372423e (patch)
treebfde8a8f9189366fb19984113eadcd1fddce6a3d /cmdline/apt-mark.cc
parent6fddb156b51b443781aa376e60e443eda09d1cad (diff)
correctly ignore already (un)hold packages
Diffstat (limited to 'cmdline/apt-mark.cc')
-rw-r--r--cmdline/apt-mark.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc
index b067413e3..fa4134a20 100644
--- a/cmdline/apt-mark.cc
+++ b/cmdline/apt-mark.cc
@@ -220,7 +220,7 @@ bool DoHold(CommandLine &CmdL)
bool const MarkHold = strcasecmp(CmdL.FileList[0],"hold") == 0;
- for (APT::PackageList::iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg)
+ for (APT::PackageList::iterator Pkg = pkgset.begin(); Pkg != pkgset.end();)
{
if ((Pkg->SelectedState == pkgCache::State::Hold) == MarkHold)
{
@@ -228,9 +228,10 @@ bool DoHold(CommandLine &CmdL)
ioprintf(c1out,_("%s was already set on hold.\n"), Pkg.FullName(true).c_str());
else
ioprintf(c1out,_("%s was already not hold.\n"), Pkg.FullName(true).c_str());
- pkgset.erase(Pkg);
- continue;
+ Pkg = pkgset.erase(Pkg, true);
}
+ else
+ ++Pkg;
}
bool dpkgMultiArch = false;