X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Fsearch.c;h=8f46c7e85531b6d62cbcfdc1e910d7028dfc3a7f;hb=dd0b893238d03a9bb38e793f3d935272ed73da6d;hp=cd522dae82344e36e44c96aa0e3d0b138dd567e2;hpb=14b3c5bc64a16df07583fe4b5ef2e0129d063893;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/search.c b/src/src/search.c index cd522dae8..8f46c7e85 100644 --- a/src/src/search.c +++ b/src/src/search.c @@ -464,10 +464,10 @@ Returns: a pointer to a dynamic string containing the answer, static uschar * internal_search_find(void *handle, uschar *filename, uschar *keystring) { -tree_node *t = (tree_node *)handle; -search_cache *c = (search_cache *)(t->data.ptr); -expiring_data *e; -uschar *data = NULL; +tree_node * t = (tree_node *)handle; +search_cache * c = (search_cache *)(t->data.ptr); +expiring_data * e = NULL; /* compiler quietening */ +uschar * data = NULL; int search_type = t->name[0] - '0'; int old_pool = store_pool; @@ -540,10 +540,10 @@ else } else { - t = store_get(sizeof(tree_node) + len + sizeof(expiring_data)); - e = (expiring_data *)((char *)t + sizeof(tree_node) + len); + e = store_get(sizeof(expiring_data) + sizeof(tree_node) + len); e->expiry = do_cache == UINT_MAX ? 0 : time(NULL)+do_cache; e->ptr = data; + t = (tree_node *)(e+1); memcpy(t->name, keystring, len); t->data.ptr = e; tree_insertnode(&c->item_cache, t); @@ -757,7 +757,7 @@ else if (partial >= 0) } /* If nothing has been matched, but the option to look for "*@" is set, try -replacing everthing to the left of @ by *. After a match, the wild part +replacing everything to the left of @ by *. After a match, the wild part is set to the string to the left of the @. */ if (yield == NULL && (starflags & SEARCH_STARAT) != 0)