merge

Mon, 03 Nov 2014 15:44:17 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Mon, 03 Nov 2014 15:44:17 +0100
changeset 63
ee9da935645d
parent 62
3b813c57c106 (current diff)
parent 61
e9b102d5a6f6 (diff)
child 64
112dbf7ba8b0

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

mercurial