From: Dana Jansens Date: Fri, 10 Oct 2003 16:20:48 +0000 (+0000) Subject: remove the --sm-disable from argv X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=da9bda5e9b2fcc4748ab3e7dab9dee76c6ccbce2;p=chaz%2Fopenbox remove the --sm-disable from argv --- diff --git a/openbox/session.c b/openbox/session.c index 06477987..9b94065e 100644 --- a/openbox/session.c +++ b/openbox/session.c @@ -112,13 +112,13 @@ static void save_commands() g_free(prop_cmd.vals); } -static void remove_two_args(int *argc, char ***argv, int index) +static void remove_args(int *argc, char ***argv, int index, int num) { int i; - for (i = index; i < index + 2; ++i) - (*argv)[i] = (*argv)[i+2]; - *argc -= 2; + for (i = index; i < index + num; ++i) + (*argv)[i] = (*argv)[i+num]; + *argc -= num; } static void parse_args(int *argc, char ***argv) @@ -131,7 +131,7 @@ static void parse_args(int *argc, char ***argv) g_printerr(_("--sm-client-id requires an argument\n")); else { sm_id = g_strdup((*argv)[i+1]); - remove_two_args(argc, argv, i); + remove_args(argc, argv, i, 2); ++i; } } else if (!strcmp((*argv)[i], "--sm-save-file")) { @@ -139,11 +139,12 @@ static void parse_args(int *argc, char ***argv) g_printerr(_("--sm-save-file requires an argument\n")); else { save_file = g_strdup((*argv)[i+1]); - remove_two_args(argc, argv, i); + remove_args(argc, argv, i, 2); ++i; } } else if (!strcmp((*argv)[i], "--sm-disable")) { sm_disable = TRUE; + remove_args(argc, argv, i, 1); } } }