From 00769cf7f1648cf375f9ef9137cd9a76bf64969e Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Tue, 4 Nov 2008 17:01:19 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20558672=20=E2=80=93=20NULL=20key=20lookup?= =?UTF-8?q?=20using=20g=5Fhash=5Ftable=5Flookup=5Fextended()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-11-04 Christian Dywan Bug 558672 – NULL key lookup using g_hash_table_lookup_extended() * glib/ghash.c: Clarify g_hash_table_lookup_extended svn path=/trunk/; revision=7644 --- ChangeLog | 7 +++++++ glib/ghash.c | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a9246b8b3..e1c9b6372 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-11-04 Christian Dywan + + Bug 558672 – NULL key lookup using g_hash_table_lookup_extended() + + * glib/ghash.c: + Clarify g_hash_table_lookup_extended + 2008-11-02 Tor Lillqvist * configure.in: Expand also build/win32/vs9/Makefile. diff --git a/glib/ghash.c b/glib/ghash.c index efc2707d3..ba332669d 100644 --- a/glib/ghash.c +++ b/glib/ghash.c @@ -788,16 +788,19 @@ g_hash_table_lookup (GHashTable *hash_table, /** * g_hash_table_lookup_extended: - * @hash_table: a #GHashTable. - * @lookup_key: the key to look up. - * @orig_key: returns the original key. - * @value: returns the value associated with the key. + * @hash_table: a #GHashTable + * @lookup_key: the key to look up + * @orig_key: return location for the original key, or %NULL + * @value: return location for the value associated with the key, or %NULL * * Looks up a key in the #GHashTable, returning the original key and the * associated value and a #gboolean which is %TRUE if the key was found. This * is useful if you need to free the memory allocated for the original key, * for example before calling g_hash_table_remove(). * + * You can actually pass %NULL for @lookup_key to test + * whether the %NULL key exists. + * * Return value: %TRUE if the key was found in the #GHashTable. **/ gboolean