Bladeren bron

dpkg: Do not lose track of packages owning a file

Properly reset the pkg_prev pointer for each file iteration, by moving
the variable declaration inside the loop.

Regression introduced in commit a2ee7d0bb4d56afb82438f09a50251acfa690643.

Reported-by: Raphaël Hertzog <hertzog@debian.org>
Guillem Jover 12 jaren geleden
bovenliggende
commit
b777a58ac9
1 gewijzigde bestanden met toevoegingen van 2 en 1 verwijderingen
  1. 2 1
      src/filesdb.c

+ 2 - 1
src/filesdb.c

@@ -131,7 +131,6 @@ static void
 pkg_files_blank(struct pkginfo *pkg)
 {
   struct fileinlist *current;
-  struct pkg_list *pkg_node, *pkg_prev = NULL;
 
   /* Anything to empty? */
   if (!pkg->clientdata)
@@ -140,6 +139,8 @@ pkg_files_blank(struct pkginfo *pkg)
   for (current= pkg->clientdata->files;
        current;
        current= current->next) {
+    struct pkg_list *pkg_node, *pkg_prev = NULL;
+
     /* For each file that used to be in the package,
      * go through looking for this package's entry in the list
      * of packages containing this file, and blank it out. */