summaryrefslogtreecommitdiffabout
path: root/cgit.c
authorLars Hjemli <hjemli@gmail.com>2007-05-14 22:48:31 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2007-05-14 22:48:31 (UTC)
commitea2831f1c826d92c0158474c2d07837ec2f9fd6c (patch) (side-by-side diff)
treee8d6a89bf0f50835f9c86dd642e7906e1d050df7 /cgit.c
parent6fb7d09fea94b3dd6932469283358cb24f1e7e29 (diff)
downloadcgit-ea2831f1c826d92c0158474c2d07837ec2f9fd6c.zip
cgit-ea2831f1c826d92c0158474c2d07837ec2f9fd6c.tar.gz
cgit-ea2831f1c826d92c0158474c2d07837ec2f9fd6c.tar.bz2
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 <hjemli@gmail.com>
Diffstat (limited to 'cgit.c') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 67ad103..3c11ff0 100644
--- a/cgit.c
+++ b/cgit.c
@@ -241,12 +241,14 @@ int main(int argc, const char **argv)
item.st.st_mtime = time(NULL);
cgit_repolist.length = 0;
cgit_repolist.count = 0;
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_parse_query(cgit_querystring, cgit_querystring_cb);
if (!cgit_prepare_cache(&item))
return 0;