From e549571cfad9569f9b79a590a30828c46a22a966 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Wed, 15 Oct 2008 22:50:33 +0000 Subject: [PATCH] - make iterator work withj completely empty repos --- src/repodata.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/repodata.c b/src/repodata.c index 8cd13b1..ae4d470 100644 --- a/src/repodata.c +++ b/src/repodata.c @@ -1047,7 +1047,11 @@ dataiterator_step(Dataiterator *di) case di_enterrepodata: di_enterrepodata: if (di->repodataid >= 0) - di->data = di->repo->repodata + di->repodataid; + { + if (di->repodataid >= di->repo->nrepodata) + goto di_nextsolvable; + di->data = di->repo->repodata + di->repodataid; + } if (!maybe_load_repodata(di->data, di->keyname)) goto di_nextrepodata; di->dp = solvid2data(di->data, di->solvid, &schema); @@ -1102,7 +1106,7 @@ dataiterator_step(Dataiterator *di) goto di_enterrepodata; /* FALLTHROUGH */ - case di_nextsolvable: + case di_nextsolvable: di_nextsolvable: if (!(di->flags & SEARCH_THISSOLVID)) { if (di->solvid < 0) -- 2.7.4