diff options
-rw-r--r-- | cmd.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -41,9 +41,13 @@ static void about_fn(void) | |||
41 | if (ctx.repo) { | 41 | if (ctx.repo) { |
42 | if (!ctx.qry.path && | 42 | if (!ctx.qry.path && |
43 | ctx.qry.url[strlen(ctx.qry.url) - 1] != '/' && | 43 | ctx.qry.url[strlen(ctx.qry.url) - 1] != '/' && |
44 | ctx.env.path_info[strlen(ctx.env.path_info) - 1] != '/') | 44 | ctx.env.path_info[strlen(ctx.env.path_info) - 1] != '/') { |
45 | cgit_redirect(fmtalloc("%s/", cgit_currenturl()), true); | 45 | char *currenturl = cgit_currenturl(); |
46 | else | 46 | char *redirect = fmtalloc("%s/", currenturl); |
47 | cgit_redirect(redirect, true); | ||
48 | free(currenturl); | ||
49 | free(redirect); | ||
50 | } else | ||
47 | cgit_print_repo_readme(ctx.qry.path); | 51 | cgit_print_repo_readme(ctx.qry.path); |
48 | } else | 52 | } else |
49 | cgit_print_site_readme(); | 53 | cgit_print_site_readme(); |