mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
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
This commit is contained in:
parent
f1f7e771d7
commit
60def049d9
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user