Mon, 03 Nov 2014 15:44:17 +0100
merge
--- a/dav/sync.c Mon Nov 03 15:43:04 2014 +0100 +++ b/dav/sync.c Mon Nov 03 15:44:17 2014 +0100 @@ -109,22 +109,19 @@ } static int res_matches_filter(SyncDirectory *dir, char *res_path) { - UCX_FOREACH(inc, dir->include) { regex_t* pattern = (regex_t*) inc->data; - if (regexec(pattern, res_path, 0, NULL, 0)) { - return 1; + if (regexec(pattern, res_path, 0, NULL, 0) == 0) { + UCX_FOREACH(exc, dir->exclude) { + regex_t* pattern = (regex_t*) exc->data; + if (regexec(pattern, res_path, 0, NULL, 0) == 0) { + return 1; + } + } + return 0; } } - - UCX_FOREACH(exc, dir->exclude) { - regex_t* pattern = (regex_t*) exc->data; - if (!regexec(pattern, res_path, 0, NULL, 0)) { - return 1; - } - } - - return 0; + return 1; } int cmd_pull(CmdArgs *a) {