Allow NULL strings in g_parse_debug_string. (#503862, Matthew Barnes)
authorMathias Hasselmann <hasselmm@src.gnome.org>
Sun, 16 Dec 2007 15:04:51 +0000 (15:04 +0000)
committerMathias Hasselmann <hasselmm@src.gnome.org>
Sun, 16 Dec 2007 15:04:51 +0000 (15:04 +0000)
* glib/gutils.c:
Allow NULL strings in g_parse_debug_string. (#503862, Matthew Barnes)

svn path=/trunk/; revision=6137

ChangeLog
glib/gutils.c

index a6a0cff2dc4e063fc3c7fb823dea3ea22ae62fe6..9550dc4abd0bfd705650e8cb8c561ccb1c25d325 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-16  Mathias Hasselmann  <mathias@openismus.com>
+
+       * glib/gutils.c:
+       Allow NULL strings in g_parse_debug_string. (#503862, Matthew Barnes)
+
 2007-12-14  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/glib.symbols:
index 5f7787472b93bf1fadf979dbadac1ab50b498b5b..e8336e1bf34b637fc71583e9002a0cbbbebef130 100644 (file)
@@ -565,7 +565,7 @@ debug_key_matches (const gchar *key,
 /**
  * g_parse_debug_string:
  * @string: a list of debug options separated by colons, spaces, or
- * commas; or the string "all" to set all flags.
+ * commas; or the string "all" to set all flags, or %NULL.
  * @keys: pointer to an array of #GDebugKey which associate 
  *     strings with bit flags.
  * @nkeys: the number of #GDebugKey<!-- -->s in the array.
@@ -585,7 +585,8 @@ g_parse_debug_string  (const gchar     *string,
   guint i;
   guint result = 0;
   
-  g_return_val_if_fail (string != NULL, 0);
+  if (string == NULL)
+    return 0;
 
   /* this function is used by gmem.c/gslice.c initialization code,
    * so introducing malloc dependencies here would require adaptions