From: Jo-Philipp Wich Date: Mon, 27 Feb 2017 19:19:21 +0000 (+0100) Subject: opkg_cmd: fix endless loop in whatprovides/whatreplaces X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=439c89e2be0ec0e62da6bd4b592964caff65bee1;p=oweals%2Fopkg-lede.git 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 --- 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++; } } }