X-Git-Url: https://git.cameronkatri.com/cgit.git/blobdiff_plain/92908af4558d7362c7deeb05254343a5a5f11a05..20a33548b9a87a6eb23162ee5d137daa46d78613:/cgit.c?ds=sidebyside diff --git a/cgit.c b/cgit.c index 3943a0f..1f46e0d 100644 --- a/cgit.c +++ b/cgit.c @@ -7,7 +7,9 @@ */ #include "cgit.h" +#include "cache.h" #include "cmd.h" +#include "configfile.h" #include "ui-shared.h" const char *cgit_version = CGIT_VERSION; @@ -102,7 +104,7 @@ void config_cb(const char *name, const char *value) else ctx.repo->readme = xstrdup(fmt("%s/%s", ctx.repo->path, value)); } else if (!strcmp(name, "include")) - cgit_read_config(value, config_cb); + parse_configfile(value, config_cb); } static void querystring_cb(const char *name, const char *value) @@ -181,7 +183,7 @@ static int cgit_prepare_cache(struct cacheitem *item) return 1; } - if (!cgit_cmd) { + if (!ctx.qry.page) { item->name = xstrdup(fmt("%s/%s/index.%s.html", ctx.cfg.cache_root, cache_safe_filename(ctx.repo->url), cache_safe_filename(ctx.qry.raw))); @@ -435,7 +437,7 @@ int main(int argc, const char **argv) cgit_repolist.count = 0; cgit_repolist.repos = NULL; - cgit_read_config(cgit_config_env ? cgit_config_env : CGIT_CONFIG, + parse_configfile(cgit_config_env ? cgit_config_env : CGIT_CONFIG, config_cb); if (getenv("SCRIPT_NAME")) ctx.cfg.script_name = xstrdup(getenv("SCRIPT_NAME"));