extern int am_server;
extern int am_sender;
extern int eol_nulls;
-extern int list_only;
extern int recurse;
extern int io_error;
extern int local_server;
}
}
- if (!(ret = new(struct filter_struct)))
+ if (!(ret = new0(struct filter_struct)))
out_of_memory("add_rule");
- memset(ret, 0, sizeof ret[0]);
if (!(mflags & (MATCHFLG_ABS_PATH | MATCHFLG_MERGE_FILE))
&& ((xflags & (XFLG_ANCHORED2ABS|XFLG_ABS_IF_SLASH) && *pat == '/')
void change_local_filter_dir(const char *dname, int dlen, int dir_depth)
{
- static int min_depth = MAXPATHLEN, cur_depth = -1;
+ static int cur_depth = -1;
static void *filt_array[MAXPATHLEN/2+1];
if (!dname) {
- while (cur_depth >= min_depth)
- pop_local_filters(filt_array[cur_depth--]);
- min_depth = MAXPATHLEN;
- cur_depth = -1;
+ for ( ; cur_depth >= 0; cur_depth--) {
+ if (filt_array[cur_depth]) {
+ pop_local_filters(filt_array[cur_depth]);
+ filt_array[cur_depth] = NULL;
+ }
+ }
return;
}
assert(dir_depth < MAXPATHLEN/2+1);
- while (cur_depth >= dir_depth && cur_depth >= min_depth)
- pop_local_filters(filt_array[cur_depth--]);
- cur_depth = dir_depth;
- if (cur_depth < min_depth)
- min_depth = cur_depth;
+ for ( ; cur_depth >= dir_depth; cur_depth--) {
+ if (filt_array[cur_depth]) {
+ pop_local_filters(filt_array[cur_depth]);
+ filt_array[cur_depth] = NULL;
+ }
+ }
+ cur_depth = dir_depth;
filt_array[cur_depth] = push_local_filters(dname, dlen);
}
parse_rule(&filter_list, "-C", 0, 0);
}
- /* This is a complete hack - blame Rusty. FIXME!
- * Remove this hack when older rsyncs (below 2.6.4) are gone. */
- if (list_only == 1 && !recurse)
- parse_rule(&filter_list, "/*/*", MATCHFLG_NO_PREFIXES, 0);
-
send_rules(f_out, &filter_list);
if (f_out >= 0)