]> git.cameronkatri.com Git - cgit.git/blobdiff - cmd.c
ui-tree: move set_title_from_path to ui-shared
[cgit.git] / cmd.c
diff --git a/cmd.c b/cmd.c
index 0375c5a53c5dfaad80a9adbc192903be0b5ca1c4..d280e95fb0928b853fdf33ad68edcd56273d9018 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -39,9 +39,10 @@ static void atom_fn(void)
 static void about_fn(void)
 {
        if (ctx.repo) {
+               size_t path_info_len = ctx.env.path_info ? strlen(ctx.env.path_info) : 0;
                if (!ctx.qry.path &&
                    ctx.qry.url[strlen(ctx.qry.url) - 1] != '/' &&
-                   ctx.env.path_info[strlen(ctx.env.path_info) - 1] != '/') {
+                   (!path_info_len || ctx.env.path_info[path_info_len - 1] != '/')) {
                        char *currenturl = cgit_currenturl();
                        char *redirect = fmtalloc("%s/", currenturl);
                        cgit_redirect(redirect, true);