diff --git a/data.c b/data.c index 2e682b3..60eda25 100644 --- a/data.c +++ b/data.c @@ -2499,8 +2499,10 @@ xs_list *content_search(snac *user, const char *regex, return xs_list_new(); xs_set seen; + xs_set skipped; xs_set_init(&seen); + xs_set_init(&skipped); if (max_secs == 0) max_secs = 3; @@ -2592,14 +2594,19 @@ xs_list *content_search(snac *user, const char *regex, xs *l = xs_regex_select_n(c, regex, 1); if (xs_list_len(l)) { - if (skip > 0) - skip--; - else - if (xs_set_add(&seen, md5) == 1) - show--; + if (skip > 0) { + if (xs_set_add(&skipped, md5) == 1) + skip--; + } + else { + if (xs_set_add(&seen, md5) == 1) + show--; + } } } + xs_set_free(&skipped); + return xs_set_result(&seen); } diff --git a/html.c b/html.c index d50333a..8bcfab3 100644 --- a/html.c +++ b/html.c @@ -2578,7 +2578,7 @@ int html_get_handler(const xs_dict *req, const char *q_path, else title = xs_fmt(L("Nothing found for '%s'"), q); - *body = html_timeline(&snac, tl, 0, skip, show, tl_len > 0, title, page, 1); + *body = html_timeline(&snac, tl, 0, skip, tl_len, tl_len > 0, title, page, 1); *b_size = strlen(*body); status = 200; }