mirror of
https://git.zx2c4.com/cgit
synced 2024-11-22 08:28:42 +00:00
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>
This commit is contained in:
parent
e87e896333
commit
c6f747649a
1
cgit.c
1
cgit.c
@ -440,6 +440,7 @@ int main(int argc, const char **argv)
|
|||||||
|
|
||||||
parse_configfile(cgit_config_env ? cgit_config_env : CGIT_CONFIG,
|
parse_configfile(cgit_config_env ? cgit_config_env : CGIT_CONFIG,
|
||||||
config_cb);
|
config_cb);
|
||||||
|
ctx.repo = NULL;
|
||||||
if (getenv("SCRIPT_NAME"))
|
if (getenv("SCRIPT_NAME"))
|
||||||
ctx.cfg.script_name = xstrdup(getenv("SCRIPT_NAME"));
|
ctx.cfg.script_name = xstrdup(getenv("SCRIPT_NAME"));
|
||||||
if (getenv("QUERY_STRING"))
|
if (getenv("QUERY_STRING"))
|
||||||
|
Loading…
Reference in New Issue
Block a user