From: Matthias Clasen Date: Sun, 18 Dec 2005 02:46:27 +0000 (+0000) Subject: Set an error in all failure cases. (#324332, Tim-Philipp Müller) X-Git-Tag: GLIB_2_9_2~47 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df21b345c5bc34ddb856cb639628379fd53e6dc3;p=platform%2Fupstream%2Fglib.git Set an error in all failure cases. (#324332, Tim-Philipp Müller) 2005-12-17 Matthias Clasen * glib/goption.c (parse_short_option): Set an error in all failure cases. (#324332, Tim-Philipp Müller) --- diff --git a/ChangeLog b/ChangeLog index 37e3bdae3..0805b476b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-12-17 Matthias Clasen + + * glib/goption.c (parse_short_option): Set an error in all + failure cases. (#324332, Tim-Philipp Müller) + 2005-12-17 Sebastian Wilhelmi * glib/gatomic.c: Fix memory barrier position in g_atomic_int_get diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 37e3bdae3..0805b476b 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2005-12-17 Matthias Clasen + + * glib/goption.c (parse_short_option): Set an error in all + failure cases. (#324332, Tim-Philipp Müller) + 2005-12-17 Sebastian Wilhelmi * glib/gatomic.c: Fix memory barrier position in g_atomic_int_get diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 37e3bdae3..0805b476b 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +2005-12-17 Matthias Clasen + + * glib/goption.c (parse_short_option): Set an error in all + failure cases. (#324332, Tim-Philipp Müller) + 2005-12-17 Sebastian Wilhelmi * glib/gatomic.c: Fix memory barrier position in g_atomic_int_get diff --git a/glib/goption.c b/glib/goption.c index a38edc445..820b6174d 100644 --- a/glib/goption.c +++ b/glib/goption.c @@ -921,8 +921,10 @@ parse_short_option (GOptionContext *context, { if (*new_index > index) { - g_warning ("FIXME: figure out the correct error here"); - + g_set_error (error, + G_OPTION_ERROR, G_OPTION_ERROR_FAILED, + _("Error parsing option %s"), option_name); + g_free (option_name); return FALSE; }