From: Andrew Tridgell Date: Wed, 27 May 1998 13:05:05 +0000 (+0000) Subject: - always flush the IO write buffer when reading X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/ea2111d10a10a164334eff3b621ed7e630404345 - always flush the IO write buffer when reading - handle start of line in exclude properly --- diff --git a/exclude.c b/exclude.c index 577c289b..ab01234c 100644 --- a/exclude.c +++ b/exclude.c @@ -93,13 +93,13 @@ static int check_one_exclude(char *name,struct exclude_struct *ex, } if (ex->regular_exp) { - if (fnmatch(ex->pattern, name, 0) == 0) + if (fnmatch(pattern, name, 0) == 0) return 1; } else { int l1 = strlen(name); - int l2 = strlen(ex->pattern); + int l2 = strlen(pattern); if (l2 <= l1 && - strcmp(name+(l1-l2),ex->pattern) == 0 && + strcmp(name+(l1-l2),pattern) == 0 && (l1==l2 || (!match_start && name[l1-(l2+1)] == '/'))) return 1; } diff --git a/io.c b/io.c index 4c704ebe..03da79ce 100644 --- a/io.c +++ b/io.c @@ -86,6 +86,8 @@ static int read_timeout(int fd, char *buf, int len) { int n, ret=0; + io_flush(); + while (ret == 0) { fd_set fds; struct timeval tv;