From: john at keeping.me.uk (John Keeping)
Subject: [PATCH 3/3] cgit: don't set vpath unless repo is set
Date: Sun, 19 Feb 2017 12:45:01 +0000 [thread overview]
Message-ID: <ba9b25e37596904c80f2487568ea456f8150c335.1487507852.git.john@keeping.me.uk> (raw)
In-Reply-To: <cover.1487507852.git.john@keeping.me.uk>
After the previous two patches, this can be classified as a tidy up
rather than a bug fix, but I think it makes sense to group all of the
tests together before setting up the environment for the command to
execute.
Signed-off-by: John Keeping <john at keeping.me.uk>
---
cgit.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/cgit.c b/cgit.c
index 1075753..1dae4b8 100644
--- a/cgit.c
+++ b/cgit.c
@@ -726,18 +726,18 @@ static void process_request(void)
return;
}
- /* If cmd->want_vpath is set, assume ctx.qry.path contains a "virtual"
- * in-project path limit to be made available at ctx.qry.vpath.
- * Otherwise, no path limit is in effect (ctx.qry.vpath = NULL).
- */
- ctx.qry.vpath = cmd->want_vpath ? ctx.qry.path : NULL;
-
if (cmd->want_repo && !ctx.repo) {
cgit_print_error_page(400, "Bad request",
"No repository selected");
return;
}
+ /* If cmd->want_vpath is set, assume ctx.qry.path contains a "virtual"
+ * in-project path limit to be made available at ctx.qry.vpath.
+ * Otherwise, no path limit is in effect (ctx.qry.vpath = NULL).
+ */
+ ctx.qry.vpath = cmd->want_vpath ? ctx.qry.path : NULL;
+
if (ctx.repo && prepare_repo_cmd())
return;
--
2.12.0.rc2.230.ga28edc07cd
next prev parent reply other threads:[~2017-02-19 12:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-19 12:44 [PATCH 0/3] Fix segfault found by AFL john
2017-02-19 12:44 ` [PATCH 1/3] ui-shared: don't print path crumbs without a repo john
2017-02-19 12:45 ` [PATCH 2/3] parsing: clear query path before starting john
2017-02-19 12:45 ` john [this message]
[not found] ` <CAHmME9r8zY9qOqbg7fwuB1gW76nXVcsqJ-LT2-6sjD3SuoJ-HQ@mail.gmail.com>
2017-02-19 19:04 ` [PATCH 0/3] Fix segfault found by AFL Jason
2017-02-20 1:48 ` peter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ba9b25e37596904c80f2487568ea456f8150c335.1487507852.git.john@keeping.me.uk \
--to=cgit@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).