Просмотр исходного кода

libdpkg: Do not reset pkginfo arch_next and set members in pkg_blank()

These are used to link the different instances together in the pkg-db,
and resetting them in pkg_blank() makes using this function not useful
in code accessing the db, as it would unlink the instances from the db.

Now that pkg_blank() does not initialize arch_next, pkgset_blank() has
to do it instead.
Guillem Jover лет назад: 14
Родитель
Сommit
8e111a3190
1 измененных файлов с 1 добавлено и 2 удалено
  1. 1 2
      lib/dpkg/pkg.c

+ 1 - 2
lib/dpkg/pkg.c

@@ -102,8 +102,6 @@ pkgbin_blank(struct pkgbin *pkgbin)
 void
 pkg_blank(struct pkginfo *pkg)
 {
-	pkg->set = NULL;
-	pkg->arch_next = NULL;
 	pkg->status = stat_notinstalled;
 	pkg->eflag = eflag_ok;
 	pkg->want = want_unknown;
@@ -135,6 +133,7 @@ pkgset_blank(struct pkgset *set)
 	set->depended.installed = NULL;
 	pkg_blank(&set->pkg);
 	set->pkg.set = set;
+	set->pkg.arch_next = NULL;
 }
 
 static int