The following commit has been merged in the master branch:
commit 9c8ecddf05ee97cf3bd1fbf972b1d91aa322d379
Author: Guillem Jover <[email protected]>
Date: Wed Nov 9 06:46:05 2011 +0100
libdpkg: Move wcall() out of the for loop in pkg_format_show()
diff --git a/lib/dpkg/pkg-format.c b/lib/dpkg/pkg-format.c
index 4b2eb24..da688a9 100644
--- a/lib/dpkg/pkg-format.c
+++ b/lib/dpkg/pkg-format.c
@@ -225,17 +225,17 @@ pkg_format_show(const struct pkg_format_node *head,
const struct fieldinfo *fip;
for (fip = fieldinfos; fip->name; fip++)
- if (strcasecmp(head->data, fip->name) == 0) {
- fip->wcall(&wb, pkg, pif, 0, fip);
-
- varbuf_end_str(&wb);
- varbuf_printf(&fb, fmt, wb.buf);
- varbuf_reset(&wb);
- ok = true;
+ if (strcasecmp(head->data, fip->name) == 0)
break;
- }
- if (!fip->name) {
+ if (fip->name) {
+ fip->wcall(&wb, pkg, pif, 0, fip);
+
+ varbuf_end_str(&wb);
+ varbuf_printf(&fb, fmt, wb.buf);
+ varbuf_reset(&wb);
+ ok = true;
+ } else {
const struct arbitraryfield *afp;
for (afp = pif->arbs; afp; afp = afp->next)
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]