Kaynağa Gözat

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 yıl önce
ebeveyn
işleme
bac27aba18
2 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  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
     renaming if it does not. Closes: #550252
     As a side effect, this avoids useless errors when the destination
     As a side effect, this avoids useless errors when the destination
     directory is not existent or writable. Closes: #581544
     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 ]
   [ Updated programs translations ]
   * Catalan (Guillem Jover).
   * 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);
 	plen = strlen(array->pkgs[i]->name);
 	vlen = strlen(versiondescribe(&array->pkgs[i]->installed.version,
 	vlen = strlen(versiondescribe(&array->pkgs[i]->installed.version,
 	                              vdew_nonambig));
 	                              vdew_nonambig));
-	pkg_summary(pkg, &dlen);
+	pkg_summary(array->pkgs[i], &dlen);
 
 
 	if (plen > nw) nw = plen;
 	if (plen > nw) nw = plen;
 	if (vlen > vw) vw = vlen;
 	if (vlen > vw) vw = vlen;