aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Michael Krelin <hacker@klever.net>2007-07-02 09:29:12 (JST)
committerGravatar Lars Hjemli <hjemli@gmail.com>2007-07-04 04:28:13 (JST)
commit51f6547879e2516b9850b0b3c51df044c16a8a52 (patch)
treef73a2db285a41c1c8d6ece33ec7519728a392d84
parent16a3d2779ccd56bf7954d98da547247d8796544b (diff)
downloadcgit-51f6547879e2516b9850b0b3c51df044c16a8a52.zip
cgit-51f6547879e2516b9850b0b3c51df044c16a8a52.tar.gz
make config adjustable via env variable CGIT_CONFIG
Signed-off-by: Michael Krelin <hacker@klever.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r--cgit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cgit.c b/cgit.c
index d9a03c2..1281bfa 100644
--- a/cgit.c
+++ b/cgit.c
@@ -222,6 +222,7 @@ static void cgit_parse_args(int argc, const char **argv)
222int main(int argc, const char **argv) 222int main(int argc, const char **argv)
223{ 223{
224 struct cacheitem item; 224 struct cacheitem item;
225 const char *cgit_config_env = getenv("CGIT_CONFIG");
225 226
226 htmlfd = STDOUT_FILENO; 227 htmlfd = STDOUT_FILENO;
227 item.st.st_mtime = time(NULL); 228 item.st.st_mtime = time(NULL);
@@ -229,7 +230,8 @@ int main(int argc, const char **argv)
229 cgit_repolist.count = 0; 230 cgit_repolist.count = 0;
230 cgit_repolist.repos = NULL; 231 cgit_repolist.repos = NULL;
231 232
232 cgit_read_config(CGIT_CONFIG, cgit_global_config_cb); 233 cgit_read_config(cgit_config_env ? cgit_config_env : CGIT_CONFIG,
234 cgit_global_config_cb);
233 cgit_repo = NULL; 235 cgit_repo = NULL;
234 if (getenv("SCRIPT_NAME")) 236 if (getenv("SCRIPT_NAME"))
235 cgit_script_name = xstrdup(getenv("SCRIPT_NAME")); 237 cgit_script_name = xstrdup(getenv("SCRIPT_NAME"));