From 4fbca22e4a81c570a86765ee3375fe22a80806bb Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Fri, 1 Aug 2003 19:28:19 +0000 Subject: [PATCH] g_set_prgname("") if argc is 0 as well, instead of leaving it Fri Aug 1 15:06:25 2003 Owen Taylor * gdk/gdk.c (gdk_parse_args): g_set_prgname("") if argc is 0 as well, instead of leaving it unset. (#116023, Michael Meeks) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gdk/gdk.c | 22 +++++++++++----------- 6 files changed, 41 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b3dba0be4..15b22941b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Aug 1 15:06:25 2003 Owen Taylor + + * gdk/gdk.c (gdk_parse_args): g_set_prgname("") + if argc is 0 as well, instead of leaving it unset. + (#116023, Michael Meeks) + Thu Jul 31 23:09:02 2003 Soeren Sandmann * gtk/gtktoolbar.c (gtk_toolbar_class_init): make show_arrow diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 1b3dba0be4..15b22941b8 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Fri Aug 1 15:06:25 2003 Owen Taylor + + * gdk/gdk.c (gdk_parse_args): g_set_prgname("") + if argc is 0 as well, instead of leaving it unset. + (#116023, Michael Meeks) + Thu Jul 31 23:09:02 2003 Soeren Sandmann * gtk/gtktoolbar.c (gtk_toolbar_class_init): make show_arrow diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 1b3dba0be4..15b22941b8 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Fri Aug 1 15:06:25 2003 Owen Taylor + + * gdk/gdk.c (gdk_parse_args): g_set_prgname("") + if argc is 0 as well, instead of leaving it unset. + (#116023, Michael Meeks) + Thu Jul 31 23:09:02 2003 Soeren Sandmann * gtk/gtktoolbar.c (gtk_toolbar_class_init): make show_arrow diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 1b3dba0be4..15b22941b8 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Fri Aug 1 15:06:25 2003 Owen Taylor + + * gdk/gdk.c (gdk_parse_args): g_set_prgname("") + if argc is 0 as well, instead of leaving it unset. + (#116023, Michael Meeks) + Thu Jul 31 23:09:02 2003 Soeren Sandmann * gtk/gtktoolbar.c (gtk_toolbar_class_init): make show_arrow diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 1b3dba0be4..15b22941b8 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Fri Aug 1 15:06:25 2003 Owen Taylor + + * gdk/gdk.c (gdk_parse_args): g_set_prgname("") + if argc is 0 as well, instead of leaving it unset. + (#116023, Michael Meeks) + Thu Jul 31 23:09:02 2003 Soeren Sandmann * gtk/gtktoolbar.c (gtk_toolbar_class_init): make show_arrow diff --git a/gdk/gdk.c b/gdk/gdk.c index 87d12ea469..0835aba512 100644 --- a/gdk/gdk.c +++ b/gdk/gdk.c @@ -103,7 +103,6 @@ gdk_arg_context_parse (GdkArgContext *context, gint *argc, gchar ***argv) { int i, j, k; - /* Save a copy of the original argc and argv */ if (argc && argv) { for (i = 1; i < *argc; i++) @@ -294,6 +293,7 @@ gdk_parse_args (int *argc, gdk_initialized = TRUE; + /* Save a copy of the original argc and argv */ if (argc && argv) { gdk_argc = *argc; @@ -302,17 +302,17 @@ gdk_parse_args (int *argc, for (i = 0; i < gdk_argc; i++) gdk_argv[i] = g_strdup ((*argv)[i]); gdk_argv[gdk_argc] = NULL; + } - if (*argc > 0) - { - gchar *d; - - d = strrchr((*argv)[0], G_DIR_SEPARATOR); - if (d != NULL) - g_set_prgname (d + 1); - else - g_set_prgname ((*argv)[0]); - } + if (argc && argv && *argc > 0) + { + gchar *d; + + d = strrchr((*argv)[0], G_DIR_SEPARATOR); + if (d != NULL) + g_set_prgname (d + 1); + else + g_set_prgname ((*argv)[0]); } else {