]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/acquire.cc
Fixed remove iteration
[apt.git] / apt-pkg / acquire.cc
index ae3ba2e01caf46287274c9f4a8149a8b875fd086..74bdaf85bf20ea4e714e1fc10fe6f583709547f6 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: acquire.cc,v 1.48 2001/05/22 04:17:18 jgg Exp $
+// $Id: acquire.cc,v 1.49 2001/05/27 04:28:37 jgg Exp $
 /* ######################################################################
 
    Acquire - File Acquiration
@@ -113,13 +113,15 @@ void pkgAcquire::Remove(Item *Itm)
 {
    Dequeue(Itm);
    
-   for (ItemIterator I = Items.begin(); I != Items.end(); I++)
+   for (ItemIterator I = Items.begin(); I != Items.end();)
    {
       if (*I == Itm)
       {
         Items.erase(I);
         I = Items.begin();
       }      
+      else 
+        I++;
    }
 }
                                                                        /*}}}*/