commit 75f21c89e332a6dc9f91f4382e096e0892bf92e6 from: Tracey Emery date: Tue Feb 18 21:42:37 2020 UTC reduce gw_index np_wrapper code to one if statement commit - bf4484a3a9b50a9bc85902b6fd72003f40c950c2 commit + 75f21c89e332a6dc9f91f4382e096e0892bf92e6 blob - eb0a376938133f8b43f6010c1d94dcaedfc058ce blob + 28bc103001f03c88997d73369a4a6dad779dde49 --- gotweb/gotweb.c +++ gotweb/gotweb.c @@ -828,19 +828,11 @@ gw_index(struct gw_trans *gw_trans) if (gw_trans->gw_conf->got_max_repos_display == 0) continue; - if (next_disp == gw_trans->gw_conf->got_max_repos_display) { - kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV, - KATTR_ID, "np_wrapper", KATTR__MAX); - if (kerr != KCGI_OK) - goto done; - kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV, - KATTR_ID, "nav_prev", KATTR__MAX); - if (kerr != KCGI_OK) - goto done; - } else if ((gw_trans->gw_conf->got_max_repos_display > 0) && + if ((next_disp == gw_trans->gw_conf->got_max_repos_display) || + ((gw_trans->gw_conf->got_max_repos_display > 0) && (gw_trans->page > 0) && (next_disp == gw_trans->gw_conf->got_max_repos_display || - prev_disp == gw_trans->repos_total)) { + prev_disp == gw_trans->repos_total))) { kerr = khtml_attr(gw_trans->gw_html_req, KELEM_DIV, KATTR_ID, "np_wrapper", KATTR__MAX); if (kerr != KCGI_OK)