Переглянути джерело

dpkg: fix regression when using -R option

The regression was introduced in commit
280ac914cc52ee5de079c0833bb1df5005c1e7ab. The variable used for the loop
got incremented twice for each iteration, the net result is that the list
of filenames contains random data on half of the entries.

Reported-by: Craig Sanders <cas@taz.net.au>
Raphaël Hertzog 15 роки тому
батько
коміт
fddba30d74
2 змінених файлів з 8 додано та 1 видалено
  1. 7 0
      debian/changelog
  2. 1 1
      src/archives.c

+ 7 - 0
debian/changelog

@@ -1,3 +1,10 @@
+dpkg (1.16.0.1) UNRELEASED; urgency=low
+
+  [ Raphaël Hertzog ]
+  * Fix regression affecting dpkg -R. Closes: #620636
+
+ -- Raphaël Hertzog <hertzog@debian.org>  Sun, 03 Apr 2011 15:06:32 +0200
+
 dpkg (1.16.0) unstable; urgency=low
 
   [ Guillem Jover ]

+ 1 - 1
src/archives.c

@@ -1269,7 +1269,7 @@ archivefiles(const char *const *argv)
     arglist= m_malloc(sizeof(char*)*(nfiles+1));
     p = findoutput.buf;
     for (i = 0; i < nfiles; i++) {
-      arglist[i++]= p;
+      arglist[i] = p;
       while (*p++ != '\0') ;
     }
     arglist[i] = NULL;