[PATCH 07/07] Close filter only if it was opened.

The Ranger ranger at risk.ee
Fri Nov 27 21:46:45 CET 2015


---
 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



More information about the CGit mailing list