diff options
author | Timo Teräs <timo.teras@iki.fi> | 2013-06-18 13:01:51 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2013-06-18 13:02:27 +0300 |
commit | fe41ae07b90bbd4609ee6871def851a41027aae8 (patch) | |
tree | 7f5a872c5ee030450e3cfdb84a73c9338f69d7f4 /src/apk.c | |
parent | c51d82f8f616c2c8939b74c1d78f723ef778f0c8 (diff) | |
download | apk-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.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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) |