summaryrefslogtreecommitdiff
path: root/apt-pkg/cacheiterators.h
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/cacheiterators.h')
-rw-r--r--apt-pkg/cacheiterators.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index 62d2695dd..c3a0d0a5a 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -222,7 +222,7 @@ class pkgCache::PrvIterator
void operator ++(int) {if (Prv != Owner->ProvideP) Prv = Owner->ProvideP +
(Type == PrvVer?Prv->NextPkgProv:Prv->NextProvides);};
inline void operator ++() {operator ++(0);};
- inline bool end() const {return Prv == Owner->ProvideP?true:false;};
+ inline bool end() const {return Owner == 0 || Prv == Owner->ProvideP?true:false;};
// Comparison
inline bool operator ==(const PrvIterator &B) const {return Prv == B.Prv;};
@@ -244,6 +244,8 @@ class pkgCache::PrvIterator
inline PkgIterator OwnerPkg() {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[Prv->Version].ParentPkg);};
inline unsigned long Index() const {return Prv - Owner->ProvideP;};
+ inline PrvIterator() : Prv(0), Type(PrvVer), Owner(0) {};
+
inline PrvIterator(pkgCache &Owner,Provides *Trg,Version *) :
Prv(Trg), Type(PrvVer), Owner(&Owner)
{