Fixed an exclude bug with --relative excluding "/".
authorWayne Davison <wayned@samba.org>
Sat, 12 Aug 2006 16:22:03 +0000 (16:22 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 12 Aug 2006 16:22:03 +0000 (16:22 +0000)
exclude.c

index bc180f2..fdb5c77 100644 (file)
--- a/exclude.c
+++ b/exclude.c
@@ -500,6 +500,8 @@ static int rule_matches(char *name, struct filter_struct *ex, int name_is_dir)
        char *p, *pattern = ex->pattern;
        const char *strings[16]; /* more than enough */
 
+       if (*name == '/')
+               name++;
        if (!*name)
                return 0;
 
@@ -531,8 +533,6 @@ static int rule_matches(char *name, struct filter_struct *ex, int name_is_dir)
        if (*pattern == '/') {
                anchored_match = 1;
                pattern++;
-               if (strings[0][0] == '/')
-                       strings[0]++;
        }
 
        if (!anchored_match && ex->u.slash_cnt