]> granicus.if.org Git - cgit/commitdiff
redirect: be more careful for different cgi setups
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 13 Aug 2015 09:38:27 +0000 (11:38 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Thu, 13 Aug 2015 09:39:20 +0000 (11:39 +0200)
cmd.c

diff --git a/cmd.c b/cmd.c
index e86b0ea3d1322cf600d438e13a7383d037a9286f..315edc3519486bb0d921c20289e6aefcc90df031 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -46,7 +46,10 @@ static void about_fn(void)
 
 static void about_pre(void)
 {
-       if (ctx.repo && !ctx.qry.path && ctx.qry.url[strlen(ctx.qry.url) - 1] != '/')
+       if (ctx.repo &&
+           !ctx.qry.path &&
+           ctx.qry.url[strlen(ctx.qry.url) - 1] != '/' &&
+           ctx.env.path_info[strlen(ctx.env.path_info) - 1] != '/')
                cgit_redirect(fmtalloc("%s/", cgit_currenturl()), true);
 }