diff --git a/ChangeLog b/ChangeLog index 19902d7d7..8946716af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-06-22 Matthias Clasen + + * glib/goption.c (parse_short_option, parse_long_option): + Pass the option name also in the NO_ARG case. (#308602, + Masatake YAMATO) + 2005-06-22 Tor Lillqvist * glib/gfileutils.c (g_makepath): New function. Creates a diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 19902d7d7..8946716af 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2005-06-22 Matthias Clasen + + * glib/goption.c (parse_short_option, parse_long_option): + Pass the option name also in the NO_ARG case. (#308602, + Masatake YAMATO) + 2005-06-22 Tor Lillqvist * glib/gfileutils.c (g_makepath): New function. Creates a diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 19902d7d7..8946716af 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,9 @@ +2005-06-22 Matthias Clasen + + * glib/goption.c (parse_short_option, parse_long_option): + Pass the option name also in the NO_ARG case. (#308602, + Masatake YAMATO) + 2005-06-22 Tor Lillqvist * glib/gfileutils.c (g_makepath): New function. Creates a diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 19902d7d7..8946716af 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2005-06-22 Matthias Clasen + + * glib/goption.c (parse_short_option, parse_long_option): + Pass the option name also in the NO_ARG case. (#308602, + Masatake YAMATO) + 2005-06-22 Tor Lillqvist * glib/gfileutils.c (g_makepath): New function. Creates a diff --git a/glib/goption.c b/glib/goption.c index 78a66c768..a432acaf0 100644 --- a/glib/goption.c +++ b/glib/goption.c @@ -904,8 +904,13 @@ parse_short_option (GOptionContext *context, { if (NO_ARG (&group->entries[j])) { + gchar *option_name; + + option_name = g_strdup_printf ("-%c", group->entries[j].short_name); parse_arg (context, group, &group->entries[j], - NULL, NULL, error); + NULL, option_name, error); + g_free (option_name); + *parsed = TRUE; } else @@ -972,8 +977,12 @@ parse_long_option (GOptionContext *context, if (NO_ARG (&group->entries[j]) && strcmp (arg, group->entries[j].long_name) == 0) { + gchar *option_name; + + option_name = g_strconcat ("--", group->entries[j].long_name, NULL); parse_arg (context, group, &group->entries[j], - NULL, NULL, error); + NULL, option_name, error); + g_free(option_name); add_pending_null (context, &((*argv)[*index]), NULL); *parsed = TRUE;