struct file_struct *file, int ndx,
int f_out, int f_out_name)
{
- static int missing_below = -1;
+ static int missing_below = -1, excluded_below = -1;
static char *fuzzy_dirname = NULL;
static struct file_list *fuzzy_dirlist = NULL;
struct file_struct *fuzzy_file = NULL;
int statret, stat_errno;
char *fnamecmp, *partialptr, *backupptr = NULL;
char fnamecmpbuf[MAXPATHLEN];
- int itemizing, maybe_DEL_TERSE, maybe_PERMS_REPORT;
+ int itemizing, maybe_PERMS_REPORT;
uchar fnamecmp_type;
enum logcode code;
if (protocol_version >= 29) {
itemizing = 1;
code = daemon_log_format_has_i ? 0 : FLOG;
- maybe_DEL_TERSE = log_format_has_o_or_i ? 0 : DEL_TERSE;
maybe_PERMS_REPORT = log_format_has_i ? 0 : PERMS_REPORT;
} else if (am_daemon) {
itemizing = daemon_log_format_has_i && !dry_run;
code = itemizing || dry_run ? FCLIENT : FINFO;
- maybe_DEL_TERSE = DEL_TERSE;
maybe_PERMS_REPORT = PERMS_REPORT;
} else if (!am_server) {
itemizing = log_format_has_i;
code = itemizing ? 0 : FINFO;
- maybe_DEL_TERSE = log_format_has_o_or_i ? 0 : DEL_TERSE;
maybe_PERMS_REPORT = log_format_has_i ? 0 : PERMS_REPORT;
} else {
itemizing = 0;
code = FINFO;
- maybe_DEL_TERSE = DEL_TERSE;
maybe_PERMS_REPORT = PERMS_REPORT;
}
safe_fname(fname), ndx);
}
- if (server_filter_list.head
- && check_filter(&server_filter_list, fname,
- S_ISDIR(file->mode)) < 0) {
- if (verbose) {
- rprintf(FINFO, "skipping server-excluded file \"%s\"\n",
- safe_fname(fname));
+ if (server_filter_list.head) {
+ if (excluded_below >= 0) {
+ if (file->dir.depth > excluded_below)
+ goto skipping;
+ excluded_below = -1;
+ }
+ if (check_filter(&server_filter_list, fname,
+ S_ISDIR(file->mode)) < 0) {
+ if (S_ISDIR(file->mode))
+ excluded_below = file->dir.depth;
+ skipping:
+ if (verbose) {
+ rprintf(FINFO,
+ "skipping server-excluded file \"%s\"\n",
+ safe_fname(fname));
+ }
+ return;
}
- return;
}
if (missing_below >= 0 && file->dir.depth <= missing_below) {
* we need to delete it. If it doesn't exist, then
* (perhaps recursively) create it. */
if (statret == 0 && !S_ISDIR(st.st_mode)) {
- delete_file(fname, st.st_mode, maybe_DEL_TERSE);
+ delete_file(fname, st.st_mode, DEL_TERSE);
statret = -1;
}
if (dry_run && statret != 0 && missing_below < 0) {
if (S_ISLNK(st.st_mode))
delete_file(fname, st.st_mode, DEL_TERSE);
else {
- delete_file(fname, st.st_mode, maybe_DEL_TERSE);
+ delete_file(fname, st.st_mode, DEL_TERSE);
statret = -1;
}
}
if (IS_DEVICE(st.st_mode))
delete_file(fname, st.st_mode, DEL_TERSE);
else {
- delete_file(fname, st.st_mode, maybe_DEL_TERSE);
+ delete_file(fname, st.st_mode, DEL_TERSE);
statret = -1;
}
if (verbose > 2) {
}
if (statret == 0 && !S_ISREG(st.st_mode)) {
- if (delete_file(fname, st.st_mode, maybe_DEL_TERSE) != 0)
+ if (delete_file(fname, st.st_mode, DEL_TERSE) != 0)
return;
statret = -1;
stat_errno = ENOENT;