minor man page update
[rsync/rsync.git] / exclude.c
index 1b5373d..8a1dfe3 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] == '/') {
@@ -212,6 +222,12 @@ void send_exclude_list(int f)
 {
        int i;
        extern int remote_version;
+       extern int list_only, recurse;
+
+       /* this is a complete hack - blame Rusty */
+       if (list_only && !recurse) {
+               add_exclude("/*/*", 0);
+       }
 
        if (!exclude_list) {
                write_int(f,0);