take pool from repo if pool is passed as NULL to dataiterator_init
authorKlaus Kaempf <kkaempf@suse.de>
Mon, 20 Oct 2008 14:09:23 +0000 (14:09 +0000)
committerKlaus Kaempf <kkaempf@suse.de>
Mon, 20 Oct 2008 14:09:23 +0000 (14:09 +0000)
src/repodata.c

index 8e2c88b..8ee7553 100644 (file)
@@ -956,6 +956,15 @@ int
 dataiterator_init(Dataiterator *di, Pool *pool, Repo *repo, Id p, Id keyname, const char *match, int flags)
 {
   memset(di, 0, sizeof(*di));
+  if (pool == NULL)
+    {
+      if (repo == NULL)
+       {
+         return -1;
+       }
+      pool = repo->pool;
+    }
+  
   di->pool = pool;
   if (match)
     {