went back to non-blokcing IO
[rsync/rsync.git] / exclude.c
index fefe299..a43a84a 100644 (file)
--- a/exclude.c
+++ b/exclude.c
@@ -52,7 +52,17 @@ static struct exclude_struct *make_exclude(char *pattern, int include)
 
        if (strpbrk(pattern, "*[?")) {
            ret->regular_exp = 1;
-           ret->fnmatch_flags = strstr(pattern, "**") ? 0 : FNM_PATHNAME;
+           ret->fnmatch_flags = FNM_PATHNAME;
+           if (strstr(pattern, "**")) {
+                   static int tested;
+                   if (!tested) {
+                           tested = 1;
+                           if (fnmatch("a/b/*", "a/b/c/d", FNM_PATHNAME)==0) {
+                                   rprintf(FERROR,"WARNING: fnmatch FNM_PATHNAME is broken on your system\n");
+                           }
+                   }
+                   ret->fnmatch_flags = 0;
+           }
        }
 
        if (strlen(pattern) > 1 && pattern[strlen(pattern)-1] == '/') {
@@ -94,15 +104,17 @@ static int check_one_exclude(char *name,struct exclude_struct *ex,
        }
 
        if (ex->regular_exp) {
-               if (fnmatch(pattern, name, ex->fnmatch_flags) == 0)
+               if (fnmatch(pattern, name, ex->fnmatch_flags) == 0) {
                        return 1;
+               }
        } else {
                int l1 = strlen(name);
                int l2 = strlen(pattern);
                if (l2 <= l1 && 
                    strcmp(name+(l1-l2),pattern) == 0 &&
-                   (l1==l2 || (!match_start && name[l1-(l2+1)] == '/')))
+                   (l1==l2 || (!match_start && name[l1-(l2+1)] == '/'))) {
                        return 1;
+               }
        }
 
        return 0;