X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/7462c6ac39d86cb8252ec47246569e3ddda35b6a..5e7f63f0bf98f9d7baab80430535d02915ade88c:/generator.c diff --git a/generator.c b/generator.c index 2ae88dbe..9b371e85 100644 --- a/generator.c +++ b/generator.c @@ -763,11 +763,12 @@ static void sum_sizes_sqroot(struct sum_struct *sum, int64 len) else if (len <= BLOCK_SIZE * BLOCK_SIZE) blength = BLOCK_SIZE; else { + int32 max_blength = protocol_version < 30 ? OLD_MAX_BLOCK_SIZE : MAX_BLOCK_SIZE; int32 c; int cnt; for (c = 1, l = len, cnt = 0; l >>= 2; c <<= 1, cnt++) {} - if (cnt >= 31 || c >= MAX_BLOCK_SIZE) - blength = MAX_BLOCK_SIZE; + if (c < 0 || c >= max_blength) + blength = max_blength; else { blength = 0; do { @@ -1444,6 +1445,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, if (j == -2) { itemizing = 0; code = FNONE; + statret = 1; } else if (j >= 0) statret = 1; } @@ -1466,6 +1468,10 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, goto cleanup; } } +#ifdef SUPPORT_XATTRS + if (preserve_xattrs && statret == 1) + copy_xattrs(fnamecmpbuf, fname); +#endif if (set_file_attrs(fname, file, real_ret ? NULL : &real_sx, NULL, 0) && verbose && code != FNONE && f_out != -1) rprintf(code, "%s/\n", fname); @@ -2210,7 +2216,10 @@ void generate_files(int f_out, const char *local_name) if (inc_recurse && cur_flist->parent_ndx >= 0) { struct file_struct *fp = dir_flist->files[cur_flist->parent_ndx]; - f_name(fp, fbuf); + if (solo_file) + strlcpy(fbuf, solo_file, sizeof fbuf); + else + f_name(fp, fbuf); ndx = cur_flist->ndx_start - 1; recv_generator(fbuf, fp, ndx, itemizing, code, f_out); if (delete_during && dry_run < 2 && !list_only