[Reproducible-commits] [dpkg] 20/63: dpkg: Use a node instead the head pointer to traverse the namenode list

Jérémy Bobbio lunar at moszumanska.debian.org
Fri Mar 4 17:44:42 UTC 2016


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/buildinfo
in repository dpkg.

commit 73648a0ac41522727ff67ac4a47ddca74cea5c62
Author: Guillem Jover <guillem at debian.org>
Date:   Tue Feb 16 09:26:22 2016 +0100

    dpkg: Use a node instead the head pointer to traverse the namenode list
---
 src/filesdb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/filesdb.c b/src/filesdb.c
index 5acb065..62fd09e 100644
--- a/src/filesdb.c
+++ b/src/filesdb.c
@@ -449,6 +449,7 @@ write_filelist_except(struct pkginfo *pkg, struct pkgbin *pkgbin,
                       struct fileinlist *list, enum filenamenode_flags mask)
 {
   struct atomic_file *file;
+  struct fileinlist *node;
   const char *listfile;
 
   listfile = pkg_infodb_get_file(pkg, pkgbin, LISTFILE);
@@ -456,12 +457,11 @@ write_filelist_except(struct pkginfo *pkg, struct pkgbin *pkgbin,
   file = atomic_file_new(listfile, 0);
   atomic_file_open(file);
 
-  while (list) {
-    if (!(mask && (list->namenode->flags & mask))) {
-      fputs(list->namenode->name, file->fp);
+  for (node = list; node; node = node->next) {
+    if (!(mask && (node->namenode->flags & mask))) {
+      fputs(node->namenode->name, file->fp);
       putc('\n', file->fp);
     }
-    list= list->next;
   }
 
   atomic_file_sync(file);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list