]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
cgitrc: handle value "0" for max-repo-count
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index 2de6d7f84c530f30851c2b3931eaec11ca722b1c..133f454b6dc0b46e74d3d753a4c910a07109e24e 100644 (file)
--- 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));