From 2afaadb2d760ae3b254e6f89a41d887d9e334708 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 15 Jul 2000 13:07:16 +0000 Subject: [PATCH] module_find_id() and module_find_id_str() didn't work right if the requested module didn't have the specified uniqid. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@464 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/modules.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/modules.c b/src/core/modules.c index 45b1f406..715d3291 100644 --- a/src/core/modules.c +++ b/src/core/modules.c @@ -104,7 +104,8 @@ int module_find_id(const char *module, int uniqid) if (ret != -1) { /* check that module matches */ ids = g_hash_table_lookup(idlookup, module); - if (ids == NULL || !g_hash_table_lookup_extended(ids, GINT_TO_POINTER(ret), &origkey, &id)) + if (ids == NULL || !g_hash_table_lookup_extended(ids, GINT_TO_POINTER(ret), &origkey, &id) || + GPOINTER_TO_INT(id) != uniqid) ret = -1; } @@ -126,7 +127,8 @@ const char *module_find_id_str(const char *module, int uniqid) if (ret != NULL) { /* check that module matches */ ids = g_hash_table_lookup(stridlookup, module); - if (ids == NULL || !g_hash_table_lookup_extended(ids, GINT_TO_POINTER(ret), &origkey, &id)) + if (ids == NULL || !g_hash_table_lookup_extended(ids, GINT_TO_POINTER(ret), &origkey, &id) || + (GPOINTER_TO_INT(id) != uniqid)) ret = NULL; }