]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
Integrate diffstat with diff
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index 1f46e0d701f83f3a36d2e9282f44461f956b1041..38b0ba5d0616d29f291a9017ec59cac5522cf4ff 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -10,6 +10,7 @@
 #include "cache.h"
 #include "cmd.h"
 #include "configfile.h"
 #include "cache.h"
 #include "cmd.h"
 #include "configfile.h"
+#include "html.h"
 #include "ui-shared.h"
 
 const char *cgit_version = CGIT_VERSION;
 #include "ui-shared.h"
 
 const char *cgit_version = CGIT_VERSION;
@@ -178,7 +179,9 @@ static int cgit_prepare_cache(struct cacheitem *item)
        }
 
        if (!ctx.repo) {
        }
 
        if (!ctx.repo) {
-               item->name = xstrdup(fmt("%s/index.html", ctx.cfg.cache_root));
+               item->name = xstrdup(fmt("%s/index.%s.html",
+                                        ctx.cfg.cache_root,
+                                        cache_safe_filename(ctx.qry.raw)));
                item->ttl = ctx.cfg.cache_root_ttl;
                return 1;
        }
                item->ttl = ctx.cfg.cache_root_ttl;
                return 1;
        }
@@ -439,12 +442,13 @@ int main(int argc, const char **argv)
 
        parse_configfile(cgit_config_env ? cgit_config_env : CGIT_CONFIG,
                         config_cb);
 
        parse_configfile(cgit_config_env ? cgit_config_env : CGIT_CONFIG,
                         config_cb);
+       ctx.repo = NULL;
        if (getenv("SCRIPT_NAME"))
                ctx.cfg.script_name = xstrdup(getenv("SCRIPT_NAME"));
        if (getenv("QUERY_STRING"))
                ctx.qry.raw = xstrdup(getenv("QUERY_STRING"));
        cgit_parse_args(argc, argv);
        if (getenv("SCRIPT_NAME"))
                ctx.cfg.script_name = xstrdup(getenv("SCRIPT_NAME"));
        if (getenv("QUERY_STRING"))
                ctx.qry.raw = xstrdup(getenv("QUERY_STRING"));
        cgit_parse_args(argc, argv);
-       cgit_parse_query(ctx.qry.raw, querystring_cb);
+       http_parse_querystring(ctx.qry.raw, querystring_cb);
        if (!cgit_prepare_cache(&item))
                return 0;
        if (ctx.cfg.nocache) {
        if (!cgit_prepare_cache(&item))
                return 0;
        if (ctx.cfg.nocache) {