From df21b345c5bc34ddb856cb639628379fd53e6dc3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 18 Dec 2005 02:46:27 +0000 Subject: [PATCH] =?UTF-8?q?Set=20an=20error=20in=20all=20failure=20cases.?= =?UTF-8?q?=20(#324332,=20Tim-Philipp=20M=C3=BCller)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2005-12-17 Matthias Clasen * glib/goption.c (parse_short_option): Set an error in all failure cases. (#324332, Tim-Philipp Müller) --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-12 | 5 +++++ glib/goption.c | 6 ++++-- 4 files changed, 19 insertions(+), 2 deletions(-) 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; }