Make debug string parsine case-insensitive

Fri Apr  3 20:36:35 1998  Owen Taylor  <owt1@cornell.edu>

	* gutils.c (g_parse_debug_string): Make debug string
	parsine case-insensitive

Fri Apr  3 20:36:52 1998  Owen Taylor  <owt1@cornell.edu>

	* gdk/gdk.c gtk/gtkmain.c: Accept debug options
	in the form --g[td]k[-no]-debug=xxx as well
This commit is contained in:
Owen Taylor 1998-04-04 01:56:54 +00:00 committed by Owen Taylor
parent 59d586e2ff
commit e2ae4aec47
12 changed files with 120 additions and 31 deletions

View File

@ -1,3 +1,8 @@
Fri Apr 3 20:36:52 1998 Owen Taylor <owt1@cornell.edu>
* gdk/gdk.c gtk/gtkmain.c: Accept debug options
in the form --g[td]k[-no]-debug=xxx as well
Fri Apr 3 18:33:47 1998 Owen Taylor <owt1@cornell.edu>
* gtk-config.in: Added flags --prefix[=dir] and

View File

@ -1,3 +1,8 @@
Fri Apr 3 20:36:52 1998 Owen Taylor <owt1@cornell.edu>
* gdk/gdk.c gtk/gtkmain.c: Accept debug options
in the form --g[td]k[-no]-debug=xxx as well
Fri Apr 3 18:33:47 1998 Owen Taylor <owt1@cornell.edu>
* gtk-config.in: Added flags --prefix[=dir] and

View File

@ -1,3 +1,8 @@
Fri Apr 3 20:36:52 1998 Owen Taylor <owt1@cornell.edu>
* gdk/gdk.c gtk/gtkmain.c: Accept debug options
in the form --g[td]k[-no]-debug=xxx as well
Fri Apr 3 18:33:47 1998 Owen Taylor <owt1@cornell.edu>
* gtk-config.in: Added flags --prefix[=dir] and

View File

@ -1,3 +1,8 @@
Fri Apr 3 20:36:52 1998 Owen Taylor <owt1@cornell.edu>
* gdk/gdk.c gtk/gtkmain.c: Accept debug options
in the form --g[td]k[-no]-debug=xxx as well
Fri Apr 3 18:33:47 1998 Owen Taylor <owt1@cornell.edu>
* gtk-config.in: Added flags --prefix[=dir] and

View File

@ -1,3 +1,8 @@
Fri Apr 3 20:36:52 1998 Owen Taylor <owt1@cornell.edu>
* gdk/gdk.c gtk/gtkmain.c: Accept debug options
in the form --g[td]k[-no]-debug=xxx as well
Fri Apr 3 18:33:47 1998 Owen Taylor <owt1@cornell.edu>
* gtk-config.in: Added flags --prefix[=dir] and

View File

@ -1,3 +1,8 @@
Fri Apr 3 20:36:52 1998 Owen Taylor <owt1@cornell.edu>
* gdk/gdk.c gtk/gtkmain.c: Accept debug options
in the form --g[td]k[-no]-debug=xxx as well
Fri Apr 3 18:33:47 1998 Owen Taylor <owt1@cornell.edu>
* gtk-config.in: Added flags --prefix[=dir] and

View File

@ -1,3 +1,8 @@
Fri Apr 3 20:36:52 1998 Owen Taylor <owt1@cornell.edu>
* gdk/gdk.c gtk/gtkmain.c: Accept debug options
in the form --g[td]k[-no]-debug=xxx as well
Fri Apr 3 18:33:47 1998 Owen Taylor <owt1@cornell.edu>
* gtk-config.in: Added flags --prefix[=dir] and

View File

@ -327,31 +327,47 @@ gdk_init (int *argc,
for (i = 1; i < *argc;)
{
#ifdef G_ENABLE_DEBUG
if (strcmp ("--gdk-debug", (*argv)[i]) == 0)
if ((strcmp ("--gdk-debug", (*argv)[i]) == 0) ||
(strncmp ("--gdk-debug=", (*argv)[i], 12) == 0))
{
(*argv)[i] = NULL;
gchar *equal_pos = strchr ((*argv)[i], '=');
if ((i + 1) < *argc && (*argv)[i + 1])
if (equal_pos != NULL)
{
gdk_debug_flags |= g_parse_debug_string (equal_pos+1,
gdk_debug_keys,
gdk_ndebug_keys);
}
else if ((i + 1) < *argc && (*argv)[i + 1])
{
gdk_debug_flags |= g_parse_debug_string ((*argv)[i+1],
gdk_debug_keys,
gdk_ndebug_keys);
(*argv)[i + 1] = NULL;
(*argv)[i] = NULL;
i += 1;
}
}
else if (strcmp ("--gdk-no-debug", (*argv)[i]) == 0)
{
(*argv)[i] = NULL;
}
else if ((strcmp ("--gdk-no-debug", (*argv)[i]) == 0) ||
(strncmp ("--gdk-no-debug=", (*argv)[i], 15) == 0))
{
gchar *equal_pos = strchr ((*argv)[i], '=');
if ((i + 1) < *argc && (*argv)[i + 1])
if (equal_pos != NULL)
{
gdk_debug_flags &= ~g_parse_debug_string (equal_pos+1,
gdk_debug_keys,
gdk_ndebug_keys);
}
else if ((i + 1) < *argc && (*argv)[i + 1])
{
gdk_debug_flags &= ~g_parse_debug_string ((*argv)[i+1],
gdk_debug_keys,
gdk_ndebug_keys);
(*argv)[i + 1] = NULL;
(*argv)[i] = NULL;
i += 1;
}
(*argv)[i] = NULL;
}
else
#endif /* G_ENABLE_DEBUG */

View File

@ -327,31 +327,47 @@ gdk_init (int *argc,
for (i = 1; i < *argc;)
{
#ifdef G_ENABLE_DEBUG
if (strcmp ("--gdk-debug", (*argv)[i]) == 0)
if ((strcmp ("--gdk-debug", (*argv)[i]) == 0) ||
(strncmp ("--gdk-debug=", (*argv)[i], 12) == 0))
{
(*argv)[i] = NULL;
gchar *equal_pos = strchr ((*argv)[i], '=');
if ((i + 1) < *argc && (*argv)[i + 1])
if (equal_pos != NULL)
{
gdk_debug_flags |= g_parse_debug_string (equal_pos+1,
gdk_debug_keys,
gdk_ndebug_keys);
}
else if ((i + 1) < *argc && (*argv)[i + 1])
{
gdk_debug_flags |= g_parse_debug_string ((*argv)[i+1],
gdk_debug_keys,
gdk_ndebug_keys);
(*argv)[i + 1] = NULL;
(*argv)[i] = NULL;
i += 1;
}
}
else if (strcmp ("--gdk-no-debug", (*argv)[i]) == 0)
{
(*argv)[i] = NULL;
}
else if ((strcmp ("--gdk-no-debug", (*argv)[i]) == 0) ||
(strncmp ("--gdk-no-debug=", (*argv)[i], 15) == 0))
{
gchar *equal_pos = strchr ((*argv)[i], '=');
if ((i + 1) < *argc && (*argv)[i + 1])
if (equal_pos != NULL)
{
gdk_debug_flags &= ~g_parse_debug_string (equal_pos+1,
gdk_debug_keys,
gdk_ndebug_keys);
}
else if ((i + 1) < *argc && (*argv)[i + 1])
{
gdk_debug_flags &= ~g_parse_debug_string ((*argv)[i+1],
gdk_debug_keys,
gdk_ndebug_keys);
(*argv)[i + 1] = NULL;
(*argv)[i] = NULL;
i += 1;
}
(*argv)[i] = NULL;
}
else
#endif /* G_ENABLE_DEBUG */

View File

@ -1,3 +1,8 @@
Fri Apr 3 20:36:35 1998 Owen Taylor <owt1@cornell.edu>
* gutils.c (g_parse_debug_string): Make debug string
parsine case-insensitive
Fri Apr 3 17:03:18 PST 1998 Manish Singh <yosh@gimp.org>
* gstring.c: corrected possible overrun when inserting into

View File

@ -873,7 +873,7 @@ g_parse_debug_string (const gchar *string,
g_return_val_if_fail (string != NULL, 0);
if (!strcmp (string, "ALL"))
if (!g_strcasecmp (string, "all"))
{
for (i=0; i<nkeys; i++)
result |= keys[i].value;
@ -897,7 +897,7 @@ g_parse_debug_string (const gchar *string,
*q = 0;
for (i=0; i<nkeys; i++)
if (!strcmp(keys[i].key, p))
if (!g_strcasecmp(keys[i].key, p))
result |= keys[i].value;
p = q+1;

View File

@ -18,6 +18,7 @@
#include <X11/Xlocale.h> /* so we get the right setlocale */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "gtkbutton.h"
#include "gtkhscrollbar.h"
#include "gtkhseparator.h"
@ -215,31 +216,47 @@ gtk_init (int *argc,
for (i = 1; i < *argc;)
{
if (strcmp ("--gtk-debug", (*argv)[i]) == 0)
if ((strcmp ("--gtk-debug", (*argv)[i]) == 0) ||
(strncmp ("--gtk-debug=", (*argv)[i], 12) == 0))
{
(*argv)[i] = NULL;
gchar *equal_pos = strchr ((*argv)[i], '=');
if ((i + 1) < *argc && (*argv)[i + 1])
if (equal_pos != NULL)
{
gtk_debug_flags |= g_parse_debug_string (equal_pos+1,
gtk_debug_keys,
gtk_ndebug_keys);
}
else if ((i + 1) < *argc && (*argv)[i + 1])
{
gtk_debug_flags |= g_parse_debug_string ((*argv)[i+1],
gtk_debug_keys,
gtk_ndebug_keys);
(*argv)[i + 1] = NULL;
(*argv)[i] = NULL;
i += 1;
}
}
else if (strcmp ("--gtk-no-debug", (*argv)[i]) == 0)
{
(*argv)[i] = NULL;
}
else if ((strcmp ("--gtk-no-debug", (*argv)[i]) == 0) ||
(strncmp ("--gtk-no-debug=", (*argv)[i], 15) == 0))
{
gchar *equal_pos = strchr ((*argv)[i], '=');
if ((i + 1) < *argc && (*argv)[i + 1])
if (equal_pos != NULL)
{
gtk_debug_flags &= ~g_parse_debug_string (equal_pos+1,
gtk_debug_keys,
gtk_ndebug_keys);
}
else if ((i + 1) < *argc && (*argv)[i + 1])
{
gtk_debug_flags &= ~g_parse_debug_string ((*argv)[i+1],
gtk_debug_keys,
gtk_ndebug_keys);
(*argv)[i + 1] = NULL;
(*argv)[i] = NULL;
i += 1;
}
(*argv)[i] = NULL;
}
i += 1;
}