projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f1f7e77
)
Bug 630185 — Allow NULL strings in g_quark_try_string()
author
Philip Withnall
<philip.withnall@collabora.co.uk>
Mon, 20 Sep 2010 16:56:30 +0000
(17:56 +0100)
committer
Philip Withnall
<philip.withnall@collabora.co.uk>
Tue, 21 Sep 2010 09:35:36 +0000
(10:35 +0100)
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
glib/gdataset.c
patch
|
blob
|
history
diff --git
a/glib/gdataset.c
b/glib/gdataset.c
index
9a3e8f9
..
cd3a51e
100644
(file)
--- 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));