]> git.cameronkatri.com Git - cgit.git/blobdiff - cgit.c
Clear the whole context
[cgit.git] / cgit.c
diff --git a/cgit.c b/cgit.c
index bd377881f669d44634767489dfb276dce3308426..6c7e8111c4cf31456983fe9f946cd5eb8410c3c8 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -68,9 +68,9 @@ void repo_config(struct cgit_repo *repo, const char *name, const char *value)
                repo->section = xstrdup(value);
        else if (!strcmp(name, "readme") && value != NULL) {
                if (*value == '/')
-                       ctx.repo->readme = xstrdup(value);
+                       repo->readme = xstrdup(value);
                else
-                       ctx.repo->readme = xstrdup(fmt("%s/%s", ctx.repo->path, value));
+                       repo->readme = xstrdup(fmt("%s/%s", repo->path, value));
        } else if (ctx.cfg.enable_filter_overrides) {
                if (!strcmp(name, "about-filter"))
                        repo->about_filter = new_filter(value, 0);
@@ -248,7 +248,7 @@ char *xstrdupn(const char *str)
 
 static void prepare_context(struct cgit_context *ctx)
 {
-       memset(ctx, 0, sizeof(ctx));
+       memset(ctx, 0, sizeof(*ctx));
        ctx->cfg.agefile = "info/web/last-modified";
        ctx->cfg.nocache = 0;
        ctx->cfg.cache_size = 0;