From 439c89e2be0ec0e62da6bd4b592964caff65bee1 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 27 Feb 2017 20:19:21 +0100 Subject: [PATCH] opkg_cmd: fix endless loop in whatprovides/whatreplaces Fix the loop semantics in opkg_what_provides_replaces_cmd() to properly advance the package vector pointer. Signed-off-by: Jo-Philipp Wich --- libopkg/opkg_cmd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c index a972553..d0d2877 100644 --- a/libopkg/opkg_cmd.c +++ b/libopkg/opkg_cmd.c @@ -1136,7 +1136,7 @@ opkg_what_provides_replaces_cmd(enum what_field_type what_field_type, int argc, abpkgs = pkg_get_ptr(pkg, (what_field_type == WHATPROVIDES) ? PKG_PROVIDES : PKG_REPLACES); while (abpkgs && *abpkgs) { - apkg = *abpkgs; + apkg = *abpkgs++; if (fnmatch(target, apkg->name, conf->nocase)) continue; @@ -1148,7 +1148,6 @@ opkg_what_provides_replaces_cmd(enum what_field_type what_field_type, int argc, opkg_msg(NOTICE, "\t%s %s\n", rel_str, apkg->name); opkg_message(NOTICE, "\n"); - abpkgs++; } } } -- 2.30.2