mirror of
https://git.zx2c4.com/cgit
synced 2025-06-24 02:38:40 +02:00
Introduce struct cgit_context
This struct will hold all the cgit runtime information currently found in a multitude of global variables. The first cleanup removes all querystring-related variables. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This commit is contained in:
parent
e5ed227ef0
commit
d14d77fe95
13 changed files with 156 additions and 164 deletions
|
@ -149,7 +149,7 @@ void cgit_parse_url(const char *url)
|
|||
|
||||
cgit_repo = cgit_get_repoinfo(url);
|
||||
if (cgit_repo) {
|
||||
cgit_query_repo = cgit_repo->url;
|
||||
ctx.qry.repo = cgit_repo->url;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -163,15 +163,15 @@ void cgit_parse_url(const char *url)
|
|||
continue;
|
||||
}
|
||||
|
||||
cgit_query_repo = cgit_repo->url;
|
||||
ctx.qry.repo = cgit_repo->url;
|
||||
p = strchr(cmd + 1, '/');
|
||||
if (p) {
|
||||
p[0] = '\0';
|
||||
if (p[1])
|
||||
cgit_query_path = trim_end(p + 1, '/');
|
||||
ctx.qry.path = trim_end(p + 1, '/');
|
||||
}
|
||||
cgit_cmd = cgit_get_cmd_index(cmd + 1);
|
||||
cgit_query_page = xstrdup(cmd + 1);
|
||||
ctx.qry.page = xstrdup(cmd + 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue