commit 659fa237eb8559857da5f0451c00e98ce43254a6 from: Omar Polo date: Tue Nov 22 18:50:40 2022 UTC gotwebd: use prev_disp to decide when to we've reached max_repos instead of hardcoding d_i - 2 and so expecting only "." and ".." as skipped entries, use t->prev_disp that is the number of repositories traversed until now (both skipped due to the pagination and the ones actually rendered.) ok jamsek commit - 0c2808e0c45424400028975a8975a7608c2ee3b8 commit + 659fa237eb8559857da5f0451c00e98ce43254a6 blob - 7cb4b4aa6c9a239aeb25328ef01b302f2131753a blob + fdc41cd4d2cb16ff84e4c42c6a8c826e6f239dc0 --- gotwebd/gotweb.c +++ gotwebd/gotweb.c @@ -1051,8 +1051,8 @@ gotweb_render_index(struct request *c) goto done; for (d_i = 0; d_i < d_cnt; d_i++) { - if (srv->max_repos > 0 && (d_i - 2) == srv->max_repos) - break; /* account for parent and self */ + if (srv->max_repos > 0 && t->prev_disp == srv->max_repos) + break; if (strcmp(sd_dent[d_i]->d_name, ".") == 0 || strcmp(sd_dent[d_i]->d_name, "..") == 0)