aboutsummaryrefslogtreecommitdiffstats
path: root/ui-shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui-shared.c b/ui-shared.c
index d27a5fd..d2358f2 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -945,12 +945,13 @@ static void cgit_print_path_crumbs(char *path)
945{ 945{
946 char *old_path = ctx.qry.path; 946 char *old_path = ctx.qry.path;
947 char *p = path, *q, *end = path + strlen(path); 947 char *p = path, *q, *end = path + strlen(path);
948 int levels = 0;
948 949
949 ctx.qry.path = NULL; 950 ctx.qry.path = NULL;
950 cgit_self_link("root", NULL, NULL); 951 cgit_self_link("root", NULL, NULL);
951 ctx.qry.path = p = path; 952 ctx.qry.path = p = path;
952 while (p < end) { 953 while (p < end) {
953 if (!(q = strchr(p, '/'))) 954 if (!(q = strchr(p, '/')) || levels > 15)
954 q = end; 955 q = end;
955 *q = '\0'; 956 *q = '\0';
956 html_txt("/"); 957 html_txt("/");
@@ -958,6 +959,7 @@ static void cgit_print_path_crumbs(char *path)
958 if (q < end) 959 if (q < end)
959 *q = '/'; 960 *q = '/';
960 p = q + 1; 961 p = q + 1;
962 ++levels;
961 } 963 }
962 ctx.qry.path = old_path; 964 ctx.qry.path = old_path;
963} 965}