Set an error in all failure cases. (#324332, Tim-Philipp Müller)
authorMatthias Clasen <mclasen@redhat.com>
Sun, 18 Dec 2005 02:46:27 +0000 (02:46 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 18 Dec 2005 02:46:27 +0000 (02:46 +0000)
2005-12-17  Matthias Clasen  <mclasen@redhat.com>

        * glib/goption.c (parse_short_option): Set an error in all
        failure cases.  (#324332, Tim-Philipp Müller)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
glib/goption.c

index 37e3bda..0805b47 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-17  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_short_option): Set an error in all
+       failure cases.  (#324332, Tim-Philipp Müller) 
+
 2005-12-17  Sebastian Wilhelmi  <seppi@seppi.de>
 
        * glib/gatomic.c: Fix memory barrier position in g_atomic_int_get
index 37e3bda..0805b47 100644 (file)
@@ -1,3 +1,8 @@
+2005-12-17  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_short_option): Set an error in all
+       failure cases.  (#324332, Tim-Philipp Müller) 
+
 2005-12-17  Sebastian Wilhelmi  <seppi@seppi.de>
 
        * glib/gatomic.c: Fix memory barrier position in g_atomic_int_get
index 37e3bda..0805b47 100644 (file)
@@ -1,3 +1,8 @@
+2005-12-17  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_short_option): Set an error in all
+       failure cases.  (#324332, Tim-Philipp Müller) 
+
 2005-12-17  Sebastian Wilhelmi  <seppi@seppi.de>
 
        * glib/gatomic.c: Fix memory barrier position in g_atomic_int_get
index a38edc4..820b617 100644 (file)
@@ -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;
                }