commit bce5dac1a3d52e5b3dc81458ca9b3a7d740180cb from: Stefan Sperling date: Tue Jan 28 09:51:38 2020 UTC display 'No repositories found in $got_repos_path" if gotweb finds no repos commit - f29724ddb21338a19111c7599f4b9615eb74ab1f commit + bce5dac1a3d52e5b3dc81458ca9b3a7d740180cb blob - 8428efb9bfb5bc0b42eb6fa2a14059fc8c2e74d1 blob + feeaec0342516a92a30d851606fe82b099516cb4 --- gotweb/gotweb.c +++ gotweb/gotweb.c @@ -391,6 +391,15 @@ gw_index(struct gw_trans *gw_trans) khttp_puts(gw_trans->gw_req, index_projects_header); + if (TAILQ_EMPTY(&gw_trans->gw_dirs)) { + if (asprintf(&html, index_projects_empty, + gw_trans->gw_conf->got_repos_path) == -1) + return got_error_from_errno("asprintf"); + khttp_puts(gw_trans->gw_req, html); + free(html); + return NULL; + } + TAILQ_FOREACH(gw_dir, &gw_trans->gw_dirs, entry) dir_c++; blob - ba8f6bf98ee643ed259293de2b4a7273f3952b1e blob + a34224a33530b7e47258a775a7077f8dae053f8c --- gotweb/gotweb_ui.h +++ gotweb/gotweb_ui.h @@ -287,6 +287,12 @@ char *index_projects = "" \ + "" \ + "
"; + +char *index_projects_empty = + "
" \ + "No repositories found in %s" \ "
" \ "
";