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 /cgit.c | |
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>
Diffstat (limited to 'cgit.c')
-rw-r--r-- | cgit.c | 6 |
1 files changed, 4 insertions, 2 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)); |