summaryrefslogtreecommitdiff
path: root/src/apk.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-06-18 13:01:51 +0300
committerTimo Teräs <timo.teras@iki.fi>2013-06-18 13:02:27 +0300
commitfe41ae07b90bbd4609ee6871def851a41027aae8 (patch)
tree7f5a872c5ee030450e3cfdb84a73c9338f69d7f4 /src/apk.c
parentc51d82f8f616c2c8939b74c1d78f723ef778f0c8 (diff)
downloadapk-tools-fe41ae07b90bbd4609ee6871def851a41027aae8.tar.gz
apk-tools-fe41ae07b90bbd4609ee6871def851a41027aae8.tar.bz2
apk-tools-fe41ae07b90bbd4609ee6871def851a41027aae8.tar.xz
apk-tools-fe41ae07b90bbd4609ee6871def851a41027aae8.zip
apk: use string array in applet mains, separate apk_name_foreach_matching
Diffstat (limited to 'src/apk.c')
-rw-r--r--src/apk.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/apk.c b/src/apk.c
index f5f6f13..cb039d1 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -291,6 +291,7 @@ int main(int argc, char **argv)
struct apk_repository_list *repo = NULL;
struct apk_database db;
struct apk_db_options dbopts;
+ struct apk_string_array *args;
#ifdef TEST_MODE
const char *test_installed_db = NULL;
const char *test_world = NULL;
@@ -495,7 +496,11 @@ int main(int argc, char **argv)
}
#endif
- r = applet->main(ctx, &db, argc, argv);
+ apk_string_array_init(&args);
+ apk_string_array_resize(&args, argc);
+ memcpy(args->item, argv, argc * sizeof(*argv));
+
+ r = applet->main(ctx, &db, args);
apk_db_close(&db);
if (r == -EINVAL)