From: Manish Singh Date: Sat, 28 May 2005 00:19:14 +0000 (+0000) Subject: initialize option_name before using it. X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=ba5a4d9db69cf31ad0aa90a997f0718640e18492;p=dana%2Fcg-glib.git initialize option_name before using it. Fri May 27 17:18:00 2005 Manish Singh * glib/goption.c (parse_short_option): initialize option_name before using it. --- diff --git a/ChangeLog b/ChangeLog index 30ba5c97..a671ba5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri May 27 17:18:00 2005 Manish Singh + + * glib/goption.c (parse_short_option): initialize option_name + before using it. + 2005-05-27 Matthias Clasen * glib/goption.c (parse_short_option, parse_long_option): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 30ba5c97..a671ba5a 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Fri May 27 17:18:00 2005 Manish Singh + + * glib/goption.c (parse_short_option): initialize option_name + before using it. + 2005-05-27 Matthias Clasen * glib/goption.c (parse_short_option, parse_long_option): diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 30ba5c97..a671ba5a 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +Fri May 27 17:18:00 2005 Manish Singh + + * glib/goption.c (parse_short_option): initialize option_name + before using it. + 2005-05-27 Matthias Clasen * glib/goption.c (parse_short_option, parse_long_option): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 30ba5c97..a671ba5a 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Fri May 27 17:18:00 2005 Manish Singh + + * glib/goption.c (parse_short_option): initialize option_name + before using it. + 2005-05-27 Matthias Clasen * glib/goption.c (parse_short_option, parse_long_option): diff --git a/glib/goption.c b/glib/goption.c index 4cfd459a..60303c51 100644 --- a/glib/goption.c +++ b/glib/goption.c @@ -899,6 +899,8 @@ parse_short_option (GOptionContext *context, return FALSE; } + + option_name = g_strdup_printf ("-%c", group->entries[j].short_name); if (index < *argc - 1) { @@ -914,8 +916,6 @@ parse_short_option (GOptionContext *context, g_free (option_name); return FALSE; } - - option_name = g_strdup_printf ("-%c", group->entries[j].short_name); if (!parse_arg (context, group, &group->entries[j], value, option_name, error)) { @@ -970,7 +970,7 @@ parse_long_option (GOptionContext *context, add_pending_null (context, &((*argv)[*index]), NULL); option_name = g_strconcat ("--", group->entries[j].long_name, NULL); - + if (arg[len] == '=') value = arg + len + 1; else if (*index < *argc - 1)