The branch, master has been updated via d46f831 Fix bogus "vanished file" with "./" prefixes. Fixes bug 9212. from 7cefbf1 Fix indentation that used expanded tabs.
;a=shortlog;h=master - Log ----------------------------------------------------------------- commit d46f8314b6989d8423e0de212303e989584ac30e Author: Wayne Davison <way...@samba.org> Date: Sun Oct 7 10:46:23 2012 -0700 Fix bogus "vanished file" with "./" prefixes. Fixes bug 9212. ----------------------------------------------------------------------- Summary of changes: util.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/util.c b/util.c index ea9ca7d..0938584 100644 --- a/util.c +++ b/util.c @@ -1032,7 +1032,7 @@ char *sanitize_path(char *dest, const char *p, const char *rootdir, int depth, * Also cleans the path using the clean_fname() function. */ int change_dir(const char *dir, int set_path_only) { - static int initialised; + static int initialised, skipped_chdir; unsigned int len; if (!initialised) { @@ -1048,7 +1048,7 @@ int change_dir(const char *dir, int set_path_only) return 0; len = strlen(dir); - if (len == 1 && *dir == '.') + if (len == 1 && *dir == '.' && (!skipped_chdir || set_path_only)) return 1; if (*dir == '/') { @@ -1058,6 +1058,7 @@ int change_dir(const char *dir, int set_path_only) } if (!set_path_only && chdir(dir)) return 0; + skipped_chdir = set_path_only; memcpy(curr_dir, dir, len + 1); } else { if (curr_dir_len + 1 + len >= sizeof curr_dir) { @@ -1072,9 +1073,10 @@ int change_dir(const char *dir, int set_path_only) curr_dir[curr_dir_len] = '\0'; return 0; } + skipped_chdir = set_path_only; } - curr_dir_len = clean_fname(curr_dir, CFN_COLLAPSE_DOT_DOT_DIRS); + curr_dir_len = clean_fname(curr_dir, CFN_COLLAPSE_DOT_DOT_DIRS | CFN_DROP_TRAILING_DOT_DIR); if (sanitize_paths) { if (module_dirlen > curr_dir_len) module_dirlen = curr_dir_len; -- The rsync repository. _______________________________________________ rsync-cvs mailing list rsync-cvs@lists.samba.org https://lists.samba.org/mailman/listinfo/rsync-cvs