aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.c
diff options
context:
space:
mode:
authorGravatar Lars Hjemli <hjemli@gmail.com>2008-04-09 04:27:12 (JST)
committerGravatar Lars Hjemli <hjemli@gmail.com>2008-04-09 04:27:12 (JST)
commitc6f747649ace1a92ed5dfaae9cc1ea3affe0bf51 (patch)
treec2d8ccd19974b6dfe32c5d3bffcfdf22dd526ae1 /cgit.c
parente87e89633383b8b75c68c98be3e0c14212109de2 (diff)
downloadcgit-c6f747649ace1a92ed5dfaae9cc1ea3affe0bf51.zip
cgit-c6f747649ace1a92ed5dfaae9cc1ea3affe0bf51.tar.gz
Reset ctx.repo to NULL when the config parser is finished
This global variable is used by the config parsing callback to keep track of the currently configured repository. If it is not reset to NULL when the config parser is finished, and neither `url` or `r` is specified on the querystring, cgit will wrongly consider the last configured repo as selected. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cgit.c b/cgit.c
index 763242a..6ec763f 100644
--- a/cgit.c
+++ b/cgit.c
@@ -440,6 +440,7 @@ int main(int argc, const char **argv)
440 440
441 parse_configfile(cgit_config_env ? cgit_config_env : CGIT_CONFIG, 441 parse_configfile(cgit_config_env ? cgit_config_env : CGIT_CONFIG,
442 config_cb); 442 config_cb);
443 ctx.repo = NULL;
443 if (getenv("SCRIPT_NAME")) 444 if (getenv("SCRIPT_NAME"))
444 ctx.cfg.script_name = xstrdup(getenv("SCRIPT_NAME")); 445 ctx.cfg.script_name = xstrdup(getenv("SCRIPT_NAME"));
445 if (getenv("QUERY_STRING")) 446 if (getenv("QUERY_STRING"))