diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2012-09-03 20:42:31 +0800 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2012-09-03 20:47:51 +0800 |
commit | c3fa918bdcd9f68efbc4caf6c727da0554fe0642 (patch) | |
tree | 35b7fbb696c5ddb3bc6c42290506b91c2aaaf22b | |
parent | cccd1f10983fb10278ca3612a1b20b04f0913b38 (diff) | |
download | gsoc2013-epiphany-c3fa918bdcd9f68efbc4caf6c727da0554fe0642.tar.gz gsoc2013-epiphany-c3fa918bdcd9f68efbc4caf6c727da0554fe0642.tar.zst gsoc2013-epiphany-c3fa918bdcd9f68efbc4caf6c727da0554fe0642.zip |
ephy-profile-utils: use an index variable instead of manually setting it
This allows us to extend this further cleanly.
-rw-r--r-- | lib/ephy-profile-utils.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/ephy-profile-utils.c b/lib/ephy-profile-utils.c index d5caaa9e8..829d68925 100644 --- a/lib/ephy-profile-utils.c +++ b/lib/ephy-profile-utils.c @@ -199,20 +199,20 @@ ephy_profile_utils_do_migration (int test_to_run, gboolean debug) char *index = NULL, *version = NULL; int status; char *argv[6] = { EPHY_PROFILE_MIGRATOR, "-v" }; + int i = 2; /* index for argv, start filling at 2. */ char *envp[1] = { "EPHY_LOG_MODULES=ephy-profile" }; - argv[2] = version = g_strdup_printf ("%d", EPHY_PROFILE_MIGRATION_VERSION); + argv[i++] = version = g_strdup_printf ("%d", EPHY_PROFILE_MIGRATION_VERSION); if (test_to_run != -1) { index = g_strdup_printf ("%d", test_to_run); - argv[3] = "-d"; - argv[4] = index; - argv[5] = NULL; - } else { - argv[3] = NULL; + argv[i++] = "-d"; + argv[i++] = index; } + argv[i++] = NULL; + if (debug) argv[0] = ABS_TOP_BUILD_DIR"/lib/"EPHY_PROFILE_MIGRATOR; |