# HG changeset patch # User Olaf Wintermann # Date 1415025857 -3600 # Node ID ee9da935645d99e31e0128ed59b1937d39162b40 # Parent 3b813c57c106196287fee52651733e19cee5bcfa# Parent e9b102d5a6f65f6497006e7a9061efe3a17926f7 merge diff -r 3b813c57c106 -r ee9da935645d dav/sync.c --- 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) {