X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/4124540d61405c0de67a5c0f53c96eeae29fcaae..8b602edda4fecabfc9734707210e3d30f8e8c3f1:/flist.c diff --git a/flist.c b/flist.c index 57355365..bc216eb9 100644 --- a/flist.c +++ b/flist.c @@ -211,6 +211,8 @@ int link_stat(const char *path, STRUCT_STAT * buffer) */ static int check_exclude_file(char *fname, int is_dir, int exclude_level) { + int rc; + #if 0 /* This currently never happens, so avoid a useless compare. */ if (exclude_level == NO_EXCLUDES) return 0; @@ -227,17 +229,15 @@ static int check_exclude_file(char *fname, int is_dir, int exclude_level) } } if (server_exclude_list.head - && check_exclude(&server_exclude_list, fname, is_dir, - "server pattern")) + && check_exclude(&server_exclude_list, fname, is_dir) < 0) return 1; if (exclude_level != ALL_EXCLUDES) return 0; if (exclude_list.head - && check_exclude(&exclude_list, fname, is_dir, "pattern")) - return 1; + && (rc = check_exclude(&exclude_list, fname, is_dir)) != 0) + return rc < 0; if (local_exclude_list.head - && check_exclude(&local_exclude_list, fname, is_dir, - "local-cvsignore")) + && check_exclude(&local_exclude_list, fname, is_dir) < 0) return 1; return 0; } @@ -947,7 +947,7 @@ void send_file_name(int f, struct file_list *flist, char *fname, if (recursive && S_ISDIR(file->mode) && !(file->flags & FLAG_MOUNT_POINT)) { struct exclude_list_struct last_list = local_exclude_list; - memset(&local_exclude_list, 0, sizeof local_exclude_list); + local_exclude_list.head = local_exclude_list.tail = NULL; send_directory(f, flist, f_name_to(file, fbuf)); free_exclude_list(&local_exclude_list); local_exclude_list = last_list; @@ -989,7 +989,7 @@ static void send_directory(int f, struct file_list *flist, char *dir) if (strlcpy(p, ".cvsignore", MAXPATHLEN - offset) < MAXPATHLEN - offset) { add_exclude_file(&local_exclude_list, fname, - XFLG_WORD_SPLIT | XFLG_NO_PREFIXES); + XFLG_WORD_SPLIT | XFLG_WORDS_ONLY); } else { io_error |= IOERR_GENERAL; rprintf(FINFO,