Browse Source

dpkg-query: Fix stanza delimiting on -L, -s and -p output

The code was only printing a delimiting new line on the second to last
stanza. Invert the logic and do it always except on the last one.

Closes: #606315
Guillem Jover 15 years ago
parent
commit
888c346186
2 changed files with 3 additions and 1 deletions
  1. 2 0
      debian/changelog
  2. 1 1
      src/querycmd.c

+ 2 - 0
debian/changelog

@@ -10,6 +10,8 @@ dpkg (1.15.8.7) UNRELEASED; urgency=low
   * On non-Linux use posix_fadvise(POSIX_FADV_DONTNEED) to notify the kernel
   * On non-Linux use posix_fadvise(POSIX_FADV_DONTNEED) to notify the kernel
     dpkg does not need the unpacked files any longer, and that it can start
     dpkg does not need the unpacked files any longer, and that it can start
     writeback to be able to evict them from the cache at a later point.
     writeback to be able to evict them from the cache at a later point.
+  * Fix stanza delimiting on -L, -s and -p output. This was making the output
+    for multiple packages unrealiable to parse. Closes: #606315
 
 
   [ Updated manpage translations ]
   [ Updated manpage translations ]
   * French (Christian Perrier).
   * French (Christian Perrier).

+ 1 - 1
src/querycmd.c

@@ -382,7 +382,7 @@ enqperpackage(const char *const *argv)
       internerr("unknown action '%d'", cipaction->arg);
       internerr("unknown action '%d'", cipaction->arg);
     }
     }
 
 
-    if (*(argv + 1) == NULL)
+    if (*argv != NULL)
       putchar('\n');
       putchar('\n');
 
 
     m_output(stdout, _("<standard output>"));
     m_output(stdout, _("<standard output>"));