Avoid using stderr to be as robust as possible in out-of-memory.

Thu May 10 23:21:30 2001  Owen Taylor  <otaylor@redhat.com>

	* gmessages.c (g_log_write_prefix): Avoid using stderr
	to be as robust as possible in out-of-memory.

	* gmessages.c (g_log_default_handler): Remove some dead
	code.

	* gutils.c (g_parse_debug_string): Fix to avoid mallocs.
This commit is contained in:
Owen Taylor
2001-05-14 14:53:59 +00:00
committed by Owen Taylor
parent 72df5e6cab
commit ac0bbb7605
12 changed files with 216 additions and 54 deletions

View File

@@ -437,9 +437,8 @@ g_parse_debug_string (const gchar *string,
}
else
{
gchar *str = g_strdup (string);
gchar *p = str;
gchar *q;
const gchar *p = string;
const gchar *q;
gboolean done = FALSE;
while (*p && !done)
@@ -451,16 +450,13 @@ g_parse_debug_string (const gchar *string,
done = TRUE;
}
*q = 0;
for (i=0; i<nkeys; i++)
if (!g_strcasecmp(keys[i].key, p))
if (g_strncasecmp(keys[i].key, p, q - p) == 0 &&
keys[i].key[q - p] == '\0')
result |= keys[i].value;
p = q+1;
p = q + 1;
}
g_free (str);
}
return result;