- int k;
- int count =
- (what_field_type ==
- WHATPROVIDES) ? pkg->provides_count : pkg->
- replaces_count;
- for (k = 0; k < count; k++) {
- abstract_pkg_t *apkg =
- ((what_field_type == WHATPROVIDES)
- ? pkg->provides[k]
- : pkg->replaces[k]);
- if (fnmatch
- (target, apkg->name,
- conf->nocase) == 0) {
- opkg_msg(NOTICE, " %s",
- pkg->name);
- if ((conf->
- nocase ? strcasecmp(target,
- apkg->
- name) :
- strcmp(target,
- apkg->name)) != 0)
- opkg_msg(NOTICE,
- "\t%s %s\n",
- rel_str,
- apkg->name);
- opkg_message(NOTICE, "\n");
- }
+ abpkgs = pkg_get_ptr(pkg, (what_field_type == WHATPROVIDES) ? PKG_PROVIDES : PKG_REPLACES);
+
+ while (abpkgs && *abpkgs) {
+ apkg = *abpkgs;
+
+ if (fnmatch(target, apkg->name, conf->nocase))
+ continue;
+
+ opkg_msg(NOTICE, " %s", pkg->name);
+
+ if ((conf->nocase ? strcasecmp(target, apkg->name)
+ : strcmp(target, apkg->name)))
+ opkg_msg(NOTICE, "\t%s %s\n", rel_str, apkg->name);
+
+ opkg_message(NOTICE, "\n");
+ abpkgs++;