From ea2831f1c826d92c0158474c2d07837ec2f9fd6c Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Tue, 15 May 2007 00:48:31 +0200 Subject: Don't hardcode urls when SCRIPT_NAME is available Also, let the makefile define the name of the installed cgi and use that definition as a default value for cgit_script_name variable. Signed-off-by: Lars Hjemli --- cgit.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cgit.c') diff --git a/cgit.c b/cgit.c index 67ad103..3c11ff0 100644 --- a/cgit.c +++ b/cgit.c @@ -244,6 +244,8 @@ int main(int argc, const char **argv) cgit_repolist.repos = NULL; 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); -- cgit v1.2.3-59-g8ed1b