glib r7804 - in trunk: . glib



Author: tml
Date: Mon Jan 12 11:45:52 2009
New Revision: 7804
URL: http://svn.gnome.org/viewvc/glib?rev=7804&view=rev

Log:
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.



Modified:
   trunk/ChangeLog
   trunk/glib/goption.c

Modified: trunk/glib/goption.c
==============================================================================
--- trunk/glib/goption.c	(original)
+++ trunk/glib/goption.c	Mon Jan 12 11:45:52 2009
@@ -1150,6 +1150,11 @@
 
 	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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]