summaryrefslogtreecommitdiffstats
path: root/libopkg/opkg_cmd.c
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-16 19:27:16 (EST)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-16 19:27:16 (EST)
commit2cec79cb14f343d822bb8098b022fe4344261c7f (patch)
tree40c57d90da457bc282243d1da2fbc6dc38a628da /libopkg/opkg_cmd.c
parent5f04cd13dd57779aa0828b0cd9d4181f1e7afc95 (diff)
only add pkg_vec_sort when needed
git-svn-id: http://opkg.googlecode.com/svn/trunk@184 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/opkg_cmd.c')
-rw-r--r--libopkg/opkg_cmd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
index af6c4b7..fae3085 100644
--- a/libopkg/opkg_cmd.c
+++ b/libopkg/opkg_cmd.c
@@ -711,6 +711,7 @@ static int opkg_list_cmd(opkg_conf_t *conf, int argc, char **argv)
}
available = pkg_vec_alloc();
pkg_hash_fetch_available(&conf->pkg_hash, available);
+ pkg_vec_sort(available, pkg_compare_names);
for (i=0; i < available->len; i++) {
pkg = available->pkgs[i];
/* if we have package name or pattern and pkg does not match, then skip it */
@@ -1439,6 +1440,7 @@ static int opkg_search_cmd(opkg_conf_t *conf, int argc, char **argv)
installed = pkg_vec_alloc();
pkg_hash_fetch_all_installed(&conf->pkg_hash, installed);
+ pkg_vec_sort(installed, pkg_compare_names);
for (i=0; i < installed->len; i++) {
pkg = installed->pkgs[i];
@@ -1458,9 +1460,6 @@ static int opkg_search_cmd(opkg_conf_t *conf, int argc, char **argv)
pkg_free_installed_files(pkg);
}
- /* XXX: CLEANUP: It's not obvious from the name of
- pkg_hash_fetch_all_installed that we need to call
- pkg_vec_free to avoid a memory leak. */
pkg_vec_free(installed);
return 0;