Sfoglia il codice sorgente

dpkg-query: Do not incorrectly trim package summary on --list

When computing the longest package description, the code was using
always the first package passed to list1package. Which made it trim to
an incorrect size.
Guillem Jover 16 anni fa
parent
commit
bac27aba18
2 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 2 0
      debian/changelog
  2. 1 1
      src/query.c

+ 2 - 0
debian/changelog

@@ -78,6 +78,8 @@ dpkg (1.15.8) UNRELEASED; urgency=low
     renaming if it does not. Closes: #550252
     As a side effect, this avoids useless errors when the destination
     directory is not existent or writable. Closes: #581544
+  * Properly compute the longest package description from all to be displayed
+    on “dpkg-query --list”, so that it does not get incorrectly trimmed.
 
   [ Updated programs translations ]
   * Catalan (Guillem Jover).

+ 1 - 1
src/query.c

@@ -91,7 +91,7 @@ list1package(struct pkginfo *pkg, bool *head, struct pkg_array *array)
 	plen = strlen(array->pkgs[i]->name);
 	vlen = strlen(versiondescribe(&array->pkgs[i]->installed.version,
 	                              vdew_nonambig));
-	pkg_summary(pkg, &dlen);
+	pkg_summary(array->pkgs[i], &dlen);
 
 	if (plen > nw) nw = plen;
 	if (vlen > vw) vw = vlen;