aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cgit.c
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2018-07-16 16:27:39 +0200
committerChristian Hesse <mail@eworm.de>2020-10-21 21:55:41 +0200
commit1e4187d7d24e9ae62248a1b9de606a7a9dc4ca23 (patch)
tree61af216516cede5dce361dcdb9c09b96118703fa /cgit.c
parenta4de0e810b69710c3b32f6d253d80d16dec09f36 (diff)
downloadcgit-ch/cgitrc.tar.gz
cgit-ch/cgitrc.tar.zst
cgit-ch/cgitrc.zip
cgitrc: handle value "0" for max-repo-countch/cgitrc
Setting max-repo-count to "0" makes cgit loop forever generating page links. Make this a special value to show all repositories. Signed-off-by: Christian Hesse <mail@eworm.de>
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c
index 08d81a1..80570b5 100644
--- a/cgit.c
+++ b/cgit.c
@@ -237,9 +237,11 @@ static void config_cb(const char *name, const char *value)
ctx.cfg.max_repodesc_len = atoi(value);
else if (!strcmp(name, "max-blob-size"))
ctx.cfg.max_blob_size = atoi(value);
- else if (!strcmp(name, "max-repo-count"))
+ else if (!strcmp(name, "max-repo-count")) {
ctx.cfg.max_repo_count = atoi(value);
- else if (!strcmp(name, "max-commit-count"))
+ if (ctx.cfg.max_repo_count <= 0)
+ ctx.cfg.max_repo_count = INT_MAX;
+ } else if (!strcmp(name, "max-commit-count"))
ctx.cfg.max_commit_count = atoi(value);
else if (!strcmp(name, "project-list"))
ctx.cfg.project_list = xstrdup(expand_macros(value));