X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/b33b791e6ba823589bdee416b91ad9278cb36ef2..79b5aa09a0b77b6c11e5809c19083497cfb728fe:/flist.c diff --git a/flist.c b/flist.c index 3a44aa7b..c6e0006c 100644 --- a/flist.c +++ b/flist.c @@ -638,7 +638,16 @@ struct file_list *send_file_list(int f,int argc,char *argv[]) l = strlen(fname); if (l != 1 && fname[l-1] == '/') { - strlcat(fname,".",MAXPATHLEN); + if ((l == 2) && (fname[0] == '.')) { + /* Turn ./ into just . rather than ./. + This was put in to avoid a problem with + rsync -aR --delete from ./ + The send_file_name() below of ./ was + mysteriously preventing deletes */ + fname[1] = 0; + } else { + strlcat(fname,".",MAXPATHLEN); + } } if (link_stat(fname,&st) != 0) { @@ -674,10 +683,17 @@ struct file_list *send_file_list(int f,int argc,char *argv[]) *p = '/'; for (p=fname+1; (p=strchr(p,'/')); p++) { int copy_links_saved = copy_links; + int recurse_saved = recurse; *p = 0; copy_links = copy_unsafe_links; + /* set recurse to 1 to prevent make_file + from ignoring directory, but still + turn off the recursive parameter to + send_file_name */ + recurse = 1; send_file_name(f, flist, fname, 0, 0); copy_links = copy_links_saved; + recurse = recurse_saved; *p = '/'; } } else {