X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/6ba9279fb2c52280cedaaca94783caf44ae9d324..0944563eb945f15023fd64bdc8f767a95dce4011:/exclude.c diff --git a/exclude.c b/exclude.c index 935c0c56..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; @@ -164,9 +166,9 @@ void recv_exclude_list(int f) char line[MAXPATHLEN]; int l; while ((l=read_int(f))) { - read_buf(f,line,l); - line[l] = 0; - add_exclude(line); + if (l >= MAXPATHLEN) overflow("recv_exclude_list"); + read_sbuf(f,line,l); + add_exclude(line); } }