Fix #153649, Hidetaka Iwai:

2004-09-26  Matthias Clasen  <mclasen@redhat.com>

	Fix #153649, Hidetaka Iwai:

	* glib/goption.c (parse_long_option): Don't forget to set parsed
	to TRUE when parsing a long ARG_NONE option.
	(free_changes_list): Fix the memory management for string
	and filename arrays.
This commit is contained in:
Matthias Clasen 2004-09-26 04:16:31 +00:00 committed by Matthias Clasen
parent 627f9b3350
commit 71097ac3ef
6 changed files with 50 additions and 5 deletions

View File

@ -1,3 +1,12 @@
2004-09-26 Matthias Clasen <mclasen@redhat.com>
Fix #153649, Hidetaka Iwai:
* glib/goption.c (parse_long_option): Don't forget to set parsed
to TRUE when parsing a long ARG_NONE option.
(free_changes_list): Fix the memory management for string
and filename arrays.
2004-09-22 Tor Lillqvist <tml@iki.fi> 2004-09-22 Tor Lillqvist <tml@iki.fi>
* glib/gmessages.c: [Win32] Don't ever open a console * glib/gmessages.c: [Win32] Don't ever open a console

View File

@ -1,3 +1,12 @@
2004-09-26 Matthias Clasen <mclasen@redhat.com>
Fix #153649, Hidetaka Iwai:
* glib/goption.c (parse_long_option): Don't forget to set parsed
to TRUE when parsing a long ARG_NONE option.
(free_changes_list): Fix the memory management for string
and filename arrays.
2004-09-22 Tor Lillqvist <tml@iki.fi> 2004-09-22 Tor Lillqvist <tml@iki.fi>
* glib/gmessages.c: [Win32] Don't ever open a console * glib/gmessages.c: [Win32] Don't ever open a console

View File

@ -1,3 +1,12 @@
2004-09-26 Matthias Clasen <mclasen@redhat.com>
Fix #153649, Hidetaka Iwai:
* glib/goption.c (parse_long_option): Don't forget to set parsed
to TRUE when parsing a long ARG_NONE option.
(free_changes_list): Fix the memory management for string
and filename arrays.
2004-09-22 Tor Lillqvist <tml@iki.fi> 2004-09-22 Tor Lillqvist <tml@iki.fi>
* glib/gmessages.c: [Win32] Don't ever open a console * glib/gmessages.c: [Win32] Don't ever open a console

View File

@ -1,3 +1,12 @@
2004-09-26 Matthias Clasen <mclasen@redhat.com>
Fix #153649, Hidetaka Iwai:
* glib/goption.c (parse_long_option): Don't forget to set parsed
to TRUE when parsing a long ARG_NONE option.
(free_changes_list): Fix the memory management for string
and filename arrays.
2004-09-22 Tor Lillqvist <tml@iki.fi> 2004-09-22 Tor Lillqvist <tml@iki.fi>
* glib/gmessages.c: [Win32] Don't ever open a console * glib/gmessages.c: [Win32] Don't ever open a console

View File

@ -1,3 +1,12 @@
2004-09-26 Matthias Clasen <mclasen@redhat.com>
Fix #153649, Hidetaka Iwai:
* glib/goption.c (parse_long_option): Don't forget to set parsed
to TRUE when parsing a long ARG_NONE option.
(free_changes_list): Fix the memory management for string
and filename arrays.
2004-09-22 Tor Lillqvist <tml@iki.fi> 2004-09-22 Tor Lillqvist <tml@iki.fi>
* glib/gmessages.c: [Win32] Don't ever open a console * glib/gmessages.c: [Win32] Don't ever open a console

View File

@ -587,8 +587,8 @@ parse_arg (GOptionContext *context,
entry->arg_data); entry->arg_data);
change->prev.integer = *(gint *)entry->arg_data; change->prev.integer = *(gint *)entry->arg_data;
*(gint *)entry->arg_data = data; *(gint *)entry->arg_data = data;
}
break; break;
}
case G_OPTION_ARG_CALLBACK: case G_OPTION_ARG_CALLBACK:
{ {
gchar *tmp; gchar *tmp;
@ -700,6 +700,7 @@ parse_long_option (GOptionContext *context,
NULL, NULL, error); NULL, NULL, error);
add_pending_null (context, &((*argv)[*index]), NULL); add_pending_null (context, &((*argv)[*index]), NULL);
*parsed = TRUE;
} }
else else
{ {
@ -753,10 +754,6 @@ free_changes_list (GOptionContext *context,
if (revert) if (revert)
{ {
/* Free any allocated data */
g_free (change->allocated.str);
g_strfreev (change->allocated.array.data);
switch (change->arg_type) switch (change->arg_type)
{ {
case G_OPTION_ARG_NONE: case G_OPTION_ARG_NONE:
@ -767,11 +764,14 @@ free_changes_list (GOptionContext *context,
break; break;
case G_OPTION_ARG_STRING: case G_OPTION_ARG_STRING:
case G_OPTION_ARG_FILENAME: case G_OPTION_ARG_FILENAME:
g_free (change->allocated.str);
*(gchar **)change->arg_data = change->prev.str; *(gchar **)change->arg_data = change->prev.str;
break; break;
case G_OPTION_ARG_STRING_ARRAY: case G_OPTION_ARG_STRING_ARRAY:
case G_OPTION_ARG_FILENAME_ARRAY: case G_OPTION_ARG_FILENAME_ARRAY:
g_strfreev (change->allocated.array.data);
*(gchar ***)change->arg_data = change->prev.array; *(gchar ***)change->arg_data = change->prev.array;
break;
default: default:
g_assert_not_reached (); g_assert_not_reached ();
} }