aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2018-07-16 16:27:39 +0200
committerChristian Hesse <mail@eworm.de>2018-08-15 23:05:06 +0200
commitc100b2b9507d53ca9eed4eb960b56329890eb879 (patch)
treefe91fbd93102bac41b713476f4a10d09cd353435
parentBump version. (diff)
downloadcgit-ch/cgitrc.tar.xz
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.
-rw-r--r--cgit.c6
-rw-r--r--cgitrc.5.txt3
2 files changed, 6 insertions, 3 deletions
diff --git a/cgit.c b/cgit.c
index 6301b87..e360754 100644
--- a/cgit.c
+++ b/cgit.c
@@ -225,9 +225,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));
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 34b351b..1731fda 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -269,7 +269,8 @@ max-message-length::
max-repo-count::
Specifies the number of entries to list per page on the repository
- index page. Default value: "50".
+ index page. The value "0" shows all repositories without limitation.
+ Default value: "50".
max-repodesc-length::
Specifies the maximum number of repo description characters to display