commit 57e88d7cd338f2bca9e5bcb9184ddda2ab435197 from: Omar Polo via: Thomas Adam date: Wed Nov 23 17:07:20 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 - fd34900dfd59a7967f4840865abbb4c9dd133ec8 commit + 57e88d7cd338f2bca9e5bcb9184ddda2ab435197 blob - a64f34c13f0c0970d9dd30e16a0b454e48353d13 blob + 171a7690a7a732a41b2c62d7f46f36a19e24a848 --- 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)