diff options
author | Timo Sirainen <cras@irssi.org> | 2000-07-15 13:07:16 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-07-15 13:07:16 +0000 |
commit | 2afaadb2d760ae3b254e6f89a41d887d9e334708 (patch) | |
tree | c4608c8797cf37350df76e70f926d40fccab3721 /src/core/modules.c | |
parent | 796d51afe4600377735a7d91f17796d048574ed5 (diff) | |
download | irssi-2afaadb2d760ae3b254e6f89a41d887d9e334708.zip |
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
Diffstat (limited to 'src/core/modules.c')
-rw-r--r-- | src/core/modules.c | 6 |
1 files 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; } |