summaryrefslogtreecommitdiff
path: root/glib
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-09-20 17:56:30 +0100
committerPhilip Withnall <philip.withnall@collabora.co.uk>2010-09-21 10:35:36 +0100
commit60def049d95e82c836cfc8b2f13a4ed8472f7865 (patch)
tree03af90618b6e55e341cf64a2ce0e114aefb13c24 /glib
parentf1f7e771d7b3d9f8b7c656c6d9a9d8112f32732d (diff)
downloadglib-60def049d95e82c836cfc8b2f13a4ed8472f7865.tar.gz
Bug 630185 — Allow NULL strings in g_quark_try_string()
Allow NULL strings to be passed to g_quark_try_string(), returning a 0 quark in that case, as per the existing documentation. Closes: bgo#630185
Diffstat (limited to 'glib')
-rw-r--r--glib/gdataset.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/glib/gdataset.c b/glib/gdataset.c
index 9a3e8f9f1..cd3a51eac 100644
--- a/glib/gdataset.c
+++ b/glib/gdataset.c
@@ -1000,8 +1000,10 @@ GQuark
g_quark_try_string (const gchar *string)
{
GQuark quark = 0;
- g_return_val_if_fail (string != NULL, 0);
-
+
+ if (string == NULL)
+ return 0;
+
G_LOCK (g_quark_global);
if (g_quark_ht)
quark = GPOINTER_TO_UINT (g_hash_table_lookup (g_quark_ht, string));