From mboxrd@z Thu Jan 1 00:00:00 1970 From: ranger at risk.ee (The Ranger) Date: Fri, 27 Nov 2015 20:46:45 -0000 Subject: [PATCH 07/07] Close filter only if it was opened. Message-ID: <1448657229.483934.7307.nullmailer@cypher.risk.ee> --- scan-tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scan-tree.c b/scan-tree.c index 7490e74..9909587 100644 --- a/scan-tree.c +++ b/scan-tree.c @@ -74,7 +74,8 @@ static char *xstrrchr(char *s, char *from, int c) return from < s ? NULL : from; } -static int open_project_filter(const char *action, const char *repo) { +static int open_project_filter(const char *action, const char *repo) +{ return cgit_open_filter(ctx.cfg.project_filter, action, repo, ctx.env.remote_user ? ctx.env.remote_user : "", ctx.env.server_name ? ctx.env.server_name : "", @@ -274,8 +275,7 @@ void scan_projects(const char *path, const char *projectsfile, repo_config_fn fn void scan_tree(const char *path, repo_config_fn fn) { - if (ctx.cfg.project_filter) { - open_project_filter("init", path); + if (ctx.cfg.project_filter && !open_project_filter("init", path)) { cgit_close_filter(ctx.cfg.project_filter); } -- 2.1.4