If an arg is excluded, don't include its implied dirs.
authorWayne Davison <wayned@samba.org>
Sat, 31 May 2008 18:27:13 +0000 (11:27 -0700)
committerWayne Davison <wayned@samba.org>
Sat, 31 May 2008 18:29:24 +0000 (11:29 -0700)
NEWS
flist.c

diff --git a/NEWS b/NEWS
index c77da63..9712609 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,9 @@ Changes since 3.0.2:
       (i.e. several hundred TB), warn the user and avoid sending an invalid
       checksum struct over the wire.
 
+    - If an source arg is excluded, --relative no longer adds the excluded
+      arg's implied dirs to the transfer.
+
     - Use the overflow_exit() function for overflows, not out_of_memory().
 
   ENHANCEMENTS:
diff --git a/flist.c b/flist.c
index b0b05dc..bbba3ee 100644 (file)
--- a/flist.c
+++ b/flist.c
@@ -2041,7 +2041,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
                }
 
                if (inc_recurse && relative_paths && *fbuf) {
-                       if ((p = strchr(fbuf+1, '/')) != NULL) {
+                       if ((p = strchr(fbuf+1, '/')) != NULL
+                        && !is_excluded(fbuf, S_ISDIR(st.st_mode) != 0, ALL_FILTERS)) {
                                if (p - fbuf == 1 && *fbuf == '.') {
                                        if ((fn = strchr(p+1, '/')) != NULL)
                                                p = fn;
@@ -2051,7 +2052,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
                                if (fn == p)
                                        continue;
                        }
-               } else if (implied_dirs && (p=strrchr(fbuf,'/')) && p != fbuf) {
+               } else if (implied_dirs && (p=strrchr(fbuf,'/')) && p != fbuf
+                   && !is_excluded(fbuf, S_ISDIR(st.st_mode) != 0, ALL_FILTERS)) {
                        /* Send the implied directories at the start of the
                         * source spec, so we get their permissions right. */
                        send_implied_dirs(f, flist, fbuf, fbuf, p, flags, 0);