X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/c6902d2911a383913e8ed6e1b56612cc3669b7f4..0495c1d19a1a740857029cfad02c0cf279c88718:/newsearch/newsearch.c diff --git a/newsearch/newsearch.c b/newsearch/newsearch.c index 8bdb56c1..6d76342c 100644 --- a/newsearch/newsearch.c +++ b/newsearch/newsearch.c @@ -603,7 +603,7 @@ int do_whowassearch(void *source, int cargc, char **cargv) { } void whowassearch_exe(struct searchNode *search, searchCtx *ctx) { - int matches = 0; + int i, matches = 0; whowas *ww; nick *sender = ctx->sender; senderNSExtern = sender; @@ -613,10 +613,15 @@ void whowassearch_exe(struct searchNode *search, searchCtx *ctx) { /* The top-level node needs to return a BOOL */ search=coerceNode(ctx, search, RETURNTYPE_BOOL); - for (ww = whowas_head; ww; ww = ww->next) { + for (i = whowasoffset; i < whowasoffset + WW_MAXENTRIES; i++) { + ww = &whowasrecs[i % WW_MAXENTRIES]; + + if (ww->type == WHOWAS_UNUSED) + continue; + /* Note: We're passing the nick to the filter function. The original * whowas record is in the nick's ->next field. */ - if ((search->exe)(ctx, search, ww->nick)) { + if ((search->exe)(ctx, search, &ww->nick)) { if (matches