Guard against a mis-written GOptionArgFunc that has returned FALSE but not

2009-01-12  Tor Lillqvist  <tml@novell.com>

	* glib/goption.c (parse_arg): Guard against a mis-written
	GOptionArgFunc that has returned FALSE but not set the GError.


svn path=/trunk/; revision=7804
This commit is contained in:
Tor Lillqvist 2009-01-12 11:45:52 +00:00 committed by Tor Lillqvist
parent c5e6e11d8e
commit ed2e6c0814
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2009-01-12 Tor Lillqvist <tml@novell.com>
* glib/goption.c (parse_arg): Guard against a mis-written
GOptionArgFunc that has returned FALSE but not set the GError.
2009-01-10 Matthias Clasen <mclasen@redhat.com>
Bug 566573 g_match_info_fetch_pos docs

View File

@ -1150,6 +1150,11 @@ parse_arg (GOptionContext *context,
retval = (* (GOptionArgFunc) entry->arg_data) (option_name, data, group->user_data, error);
if (!retval && error != NULL && *error == NULL)
g_set_error (error,
G_OPTION_ERROR, G_OPTION_ERROR_FAILED,
_("Error parsing option %s"), option_name);
g_free (data);
return retval;