ソースを参照

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 年 前
コミット
888c346186
共有2 個のファイルを変更した3 個の追加1 個の削除を含む
  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
     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.
+  * 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 ]
   * French (Christian Perrier).

+ 1 - 1
src/querycmd.c

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