- if (buff) {
- try_again:
- used_len = snprintf(buff, buff_len, "Package %s (%s) is installed on %s and has the following files:\n",
- pkg->name, pkg_version, pkg->dest->name) + 1;
- if (used_len > buff_len) {
- buff_len *= 2;
- buff = realloc (buff, buff_len);
- goto try_again;
- }
- for (iter = str_list_first(installed_files); iter; iter = str_list_next(installed_files, iter)) {
- used_len += strlen (iter->data) + 1;
- while (buff_len <= used_len) {
- buff_len *= 2;
- buff = realloc (buff, buff_len);
- }
- strncat(buff, iter->data, buff_len);
- strncat(buff, "\n", buff_len);
- }
- if (opkg_cb_list) opkg_cb_list(pkg->name,
- buff,
- pkg_version_str_alloc(pkg),
- pkg->state_status,
- p_userdata);
- free(buff);
- }
+ printf("Package %s (%s) is installed on %s and has the following files:\n",
+ pkg->name, pkg_version, pkg->dest->name);
+
+ for (iter=str_list_first(files); iter; iter=str_list_next(files, iter))
+ printf("%s\n", (char *)iter->data);