X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/bc63ae3f13e01874e375bb5cc606775889ed5afa..4a7144ee7e4cca2a28b484da1458ba89f022bb33:/flist.c diff --git a/flist.c b/flist.c index 2fff9cf1..969a4d62 100644 --- a/flist.c +++ b/flist.c @@ -795,7 +795,7 @@ void send_file_name(int f, struct file_list *flist, char *fname, if (write_batch) /* dw */ file->flags = FLAG_DELETE; - if (strcmp(file->basename, "")) { + if (file->basename[0]) { flist->files[flist->count++] = file; send_file_entry(file, f, base_flags); } @@ -859,7 +859,8 @@ static void send_directory(int f, struct file_list *flist, char *dir) for (di = readdir(d); di; di = readdir(d)) { char *dname = d_name(di); - if (strcmp(dname, ".") == 0 || strcmp(dname, "..") == 0) + if (dname[0] == '.' && (dname[1] == '\0' || + (dname[1] == '.' && dname[2] == '\0'))) continue; strlcpy(p, dname, MAXPATHLEN - l); send_file_name(f, flist, fname, recurse, 0); @@ -1046,8 +1047,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) send_uid_list(f); } - /* if protocol version is >= 17 then send the io_error flag */ - if (f != -1 && remote_version >= 17) { + /* send the io_error flag */ + if (f != -1) { extern int module_id; write_int(f, lp_ignore_errors(module_id) ? 0 : io_error); } @@ -1126,8 +1127,8 @@ struct file_list *recv_file_list(int f) recv_uid_list(f, flist); } - /* if protocol version is >= 17 then recv the io_error flag */ - if (f != -1 && remote_version >= 17 && !read_batch) { /* dw-added readbatch */ + /* recv the io_error flag */ + if (f != -1 && !read_batch) { /* dw-added readbatch */ extern int module_id; extern int ignore_errors; if (lp_ignore_errors(module_id) || ignore_errors) {