summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-12-06 16:14:31 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-12-06 16:14:31 +0000
commit3584677939267d86930dc146145c99252d5bf976 (patch)
tree610ca3e99622071c3f853f90e33f42220439eacc
parentb7b750b05bd2da25953c7e77e54ac72a942a37dd (diff)
downloadgdk-pixbuf-3584677939267d86930dc146145c99252d5bf976.tar.gz
Don't ignore errors from g_option_context_parse().
2005-12-06 Matthias Clasen <mclasen@redhat.com> * gdk/gdk.c (gdk_parse_args): * gtk/gtkmain.c (gtk_parse_args): Don't ignore errors from g_option_context_parse().
-rw-r--r--ChangeLog4
-rw-r--r--ChangeLog.pre-2-104
-rw-r--r--gdk/gdk.c8
-rw-r--r--gtk/gtkmain.c8
4 files changed, 22 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c6b2907fc..e50c30cf0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2005-12-06 Matthias Clasen <mclasen@redhat.com>
+ * gdk/gdk.c (gdk_parse_args):
+ * gtk/gtkmain.c (gtk_parse_args): Don't ignore errors
+ from g_option_context_parse().
+
Make it compile against GLib 2.9:
* gtk/gtkclist.h:
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index c6b2907fc..e50c30cf0 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,5 +1,9 @@
2005-12-06 Matthias Clasen <mclasen@redhat.com>
+ * gdk/gdk.c (gdk_parse_args):
+ * gtk/gtkmain.c (gtk_parse_args): Don't ignore errors
+ from g_option_context_parse().
+
Make it compile against GLib 2.9:
* gtk/gtkclist.h:
diff --git a/gdk/gdk.c b/gdk/gdk.c
index 15717aaab..8446bf91e 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -200,6 +200,7 @@ gdk_parse_args (int *argc,
{
GOptionContext *option_context;
GOptionGroup *option_group;
+ GError *error = NULL;
if (gdk_initialized)
return;
@@ -215,7 +216,12 @@ gdk_parse_args (int *argc,
g_option_group_add_entries (option_group, gdk_args);
g_option_group_add_entries (option_group, _gdk_windowing_args);
- g_option_context_parse (option_context, argc, argv, NULL);
+ if (!g_option_context_parse (option_context, argc, argv, &error))
+ {
+ g_warning ("%s", error->message);
+ g_error_free (error);
+ }
+
g_option_context_free (option_context);
GDK_NOTE (MISC, g_message ("progname: \"%s\"", g_get_prgname ()));
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 601217a4f..8c211bab1 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -675,6 +675,7 @@ gtk_parse_args (int *argc,
{
GOptionContext *option_context;
GOptionGroup *gtk_group;
+ GError *error = NULL;
if (gtk_initialized)
return TRUE;
@@ -689,7 +690,12 @@ gtk_parse_args (int *argc,
g_option_context_set_help_enabled (option_context, FALSE);
gtk_group = gtk_get_option_group (FALSE);
g_option_context_set_main_group (option_context, gtk_group);
- g_option_context_parse (option_context, argc, argv, NULL);
+ if (!g_option_context_parse (option_context, argc, argv, &error))
+ {
+ g_warning ("%s", error->message);
+ g_error_free (error);
+ }
+
g_option_context_free (option_context);
return TRUE;