opkg_cmd: fix endless loop in whatprovides/whatreplaces
[oweals/opkg-lede.git] / libopkg / opkg_cmd.c
index a97255393650621e23799142ff9722e69672ebd4..d0d2877cd32b4020c7bd7f935fd5c70d026c55c2 100644 (file)
@@ -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) {
                                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;
 
                                        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");
                                                opkg_msg(NOTICE, "\t%s %s\n", rel_str, apkg->name);
 
                                        opkg_message(NOTICE, "\n");
-                                       abpkgs++;
                                }
                        }
                }
                                }
                        }
                }