]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
Add 'linenumbers' config option
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index 5816f3d8afef84ba7ed14580a0682342f206b50e..a4788cbb34b2ac198dbdcb9d49a4e4d0d96f8ea9 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -66,6 +66,8 @@ void config_cb(const char *name, const char *value)
                ctx.cfg.index_info = xstrdup(value);
        else if (!strcmp(name, "logo-link"))
                ctx.cfg.logo_link = xstrdup(value);
+       else if (!strcmp(name, "linenumbers"))
+               ctx.cfg.linenumbers = atoi(value);
        else if (!strcmp(name, "module-link"))
                ctx.cfg.module_link = xstrdup(value);
        else if (!strcmp(name, "virtual-root")) {
@@ -539,7 +541,7 @@ int main(int argc, const char **argv)
                        ctx.qry.raw = xstrdup(fmt("%s?%s", path, qry));
                        free(qry);
                } else
-                       ctx.qry.raw = ctx.qry.url;
+                       ctx.qry.raw = xstrdup(ctx.qry.url);
                cgit_parse_url(ctx.qry.url);
        }