From: Andrew Tridgell Date: Tue, 5 May 1998 11:23:51 +0000 (+0000) Subject: a leading / in a pattern now means "use a absolute path match". This X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/0944563eb945f15023fd64bdc8f767a95dce4011 a leading / in a pattern now means "use a absolute path match". This allows you to exclude root directories without excluding subdirectories of the same name. --- diff --git a/exclude.c b/exclude.c index 83c0b39b..7504f968 100644 --- a/exclude.c +++ b/exclude.c @@ -43,6 +43,8 @@ static int check_one_exclude(char *name,char *pattern) if (!name[0]) return 0; + if (*pattern == '/' && *name != '/') pattern++; + if (is_regex(pattern)) { if (fnmatch(pattern, name, 0) == 0) return 1;