summaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
authorRocco Rutte <pdmef@gmx.net>2009-03-09 11:11:51 +0100
committerRocco Rutte <pdmef@gmx.net>2009-03-09 11:11:51 +0100
commit579dc6a5c507b6dc8133561cd711224ef5bef447 (patch)
treefc1c83911fc07b7097a417ef11f1bf80b0539383 /thread.c
parent8c99cc1a83d9a745490999fefa1743c10cac4f39 (diff)
Restore $reverse_alias feature by using case-insensitive hash keys
The fix is implemented as callbacks in the hash table so we can avoid working with copies of the mailbox keys but work on the originals instead and don't pollute the code with lower-case conversions all over the place. While I'm at it, turn int hashes into unsigned values since the hash function returns unsigned values now, too. Closes #3185.
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/thread.c b/thread.c
index 957acc0e..7382bad0 100644
--- a/thread.c
+++ b/thread.c
@@ -416,7 +416,7 @@ static THREAD *find_subject (CONTEXT *ctx, THREAD *cur)
{
struct hash_elem *ptr;
THREAD *tmp, *last = NULL;
- int hash;
+ unsigned int hash;
LIST *subjects = NULL, *oldlist;
time_t date = 0;
@@ -424,8 +424,8 @@ static THREAD *find_subject (CONTEXT *ctx, THREAD *cur)
while (subjects)
{
- hash = hash_string ((unsigned char *) subjects->data,
- ctx->subj_hash->nelem);
+ hash = ctx->subj_hash->hash_string ((unsigned char *) subjects->data,
+ ctx->subj_hash->nelem);
for (ptr = ctx->subj_hash->table[hash]; ptr; ptr = ptr->next)
{
tmp = ((HEADER *) ptr->data)->thread;
@@ -766,7 +766,7 @@ void mutt_sort_threads (CONTEXT *ctx, int init)
init = 1;
if (init)
- ctx->thread_hash = hash_create (ctx->msgcount * 2);
+ ctx->thread_hash = hash_create (ctx->msgcount * 2, 0);
/* we want a quick way to see if things are actually attached to the top of the
* thread tree or if they're just dangling, so we attach everything to a top
@@ -1319,7 +1319,7 @@ HASH *mutt_make_id_hash (CONTEXT *ctx)
HEADER *hdr;
HASH *hash;
- hash = hash_create (ctx->msgcount * 2);
+ hash = hash_create (ctx->msgcount * 2, 0);
for (i = 0; i < ctx->msgcount; i++)
{
@@ -1337,7 +1337,7 @@ HASH *mutt_make_subj_hash (CONTEXT *ctx)
HEADER *hdr;
HASH *hash;
- hash = hash_create (ctx->msgcount * 2);
+ hash = hash_create (ctx->msgcount * 2, 0);
for (i = 0; i < ctx->msgcount; i++)
{