]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
Restrict deep nesting of configfiles
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index 1d7a83fcee4f4f69ba4486b93b54623041eb01b0..3c11ff0a8f9021a20bf20771a617c7c53ebe6aac 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -243,7 +243,9 @@ int main(int argc, const char **argv)
        cgit_repolist.count = 0;
        cgit_repolist.repos = NULL;
 
-       cgit_read_config("/etc/cgitrc", cgit_global_config_cb);
+       cgit_read_config(CGIT_CONFIG, cgit_global_config_cb);
+       if (getenv("SCRIPT_NAME"))
+               cgit_script_name = xstrdup(getenv("SCRIPT_NAME"));
        if (getenv("QUERY_STRING"))
                cgit_querystring = xstrdup(getenv("QUERY_STRING"));
        cgit_parse_args(argc, argv);