diff options
author | Christian Hesse | 2018-07-16 16:27:39 +0200 |
---|---|---|
committer | Yigit Sever | 2023-07-21 03:03:51 +0300 |
commit | 319e4e08ecfdabecce1304b2c60acb09d9d2a736 (patch) | |
tree | aded0f7388ecb765914faf8d46678a2624a974bf | |
parent | 1bb668962658b4e805f56eae0e2585ade645c116 (diff) | |
download | cgit-319e4e08ecfdabecce1304b2c60acb09d9d2a736.tar.gz cgit-319e4e08ecfdabecce1304b2c60acb09d9d2a736.tar.bz2 cgit-319e4e08ecfdabecce1304b2c60acb09d9d2a736.zip |
cgitrc: handle value "0" for max-repo-count
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>
-rw-r--r-- | cgit.c | 6 | ||||
-rw-r--r-- | cgitrc.5.txt | 3 |
2 files changed, 6 insertions, 3 deletions
@@ -237,9 +237,11 @@ static void config_cb(const char *name, const char *value) | |||
237 | ctx.cfg.max_repodesc_len = atoi(value); | 237 | ctx.cfg.max_repodesc_len = atoi(value); |
238 | else if (!strcmp(name, "max-blob-size")) | 238 | else if (!strcmp(name, "max-blob-size")) |
239 | ctx.cfg.max_blob_size = atoi(value); | 239 | ctx.cfg.max_blob_size = atoi(value); |
240 | else if (!strcmp(name, "max-repo-count")) | 240 | else if (!strcmp(name, "max-repo-count")) { |
241 | ctx.cfg.max_repo_count = atoi(value); | 241 | ctx.cfg.max_repo_count = atoi(value); |
242 | else if (!strcmp(name, "max-commit-count")) | 242 | if (ctx.cfg.max_repo_count <= 0) |
243 | ctx.cfg.max_repo_count = INT_MAX; | ||
244 | } else if (!strcmp(name, "max-commit-count")) | ||
243 | ctx.cfg.max_commit_count = atoi(value); | 245 | ctx.cfg.max_commit_count = atoi(value); |
244 | else if (!strcmp(name, "project-list")) | 246 | else if (!strcmp(name, "project-list")) |
245 | ctx.cfg.project_list = xstrdup(expand_macros(value)); | 247 | ctx.cfg.project_list = xstrdup(expand_macros(value)); |
diff --git a/cgitrc.5.txt b/cgitrc.5.txt index d9eb3b0..463d90c 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt | |||
@@ -269,7 +269,8 @@ max-message-length:: | |||
269 | 269 | ||
270 | max-repo-count:: | 270 | max-repo-count:: |
271 | Specifies the number of entries to list per page on the repository | 271 | Specifies the number of entries to list per page on the repository |
272 | index page. Default value: "50". | 272 | index page. The value "0" shows all repositories without limitation. |
273 | Default value: "50". | ||
273 | 274 | ||
274 | max-repodesc-length:: | 275 | max-repodesc-length:: |
275 | Specifies the maximum number of repo description characters to display | 276 | Specifies the maximum number of repo description characters to display |