diff --git a/options.c b/options.c
--- a/options.c
+++ b/options.c
-@@ -148,10 +148,14 @@ int no_detach
+@@ -149,10 +149,14 @@ int no_detach
int write_batch = 0;
int read_batch = 0;
int backup_dir_len = 0;
char *tmpdir = NULL;
char *partial_dir = NULL;
char *basis_dir[MAX_BASIS_DIRS+1];
-@@ -163,7 +167,9 @@ char *stdout_format = NULL;
+@@ -164,7 +168,9 @@ char *stdout_format = NULL;
char *password_file = NULL;
char *rsync_path = RSYNC_PATH;
char *backup_dir = NULL;
char *sockopts = NULL;
int rsync_port = 0;
int compare_dest = 0;
-@@ -319,6 +325,8 @@ void usage(enum logcode F)
+@@ -320,6 +326,8 @@ void usage(enum logcode F)
rprintf(F," -b, --backup make backups (see --suffix & --backup-dir)\n");
rprintf(F," --backup-dir=DIR make backups into hierarchy based in DIR\n");
rprintf(F," --suffix=SUFFIX set backup suffix (default %s w/o --backup-dir)\n",BACKUP_SUFFIX);
rprintf(F," -u, --update skip files that are newer on the receiver\n");
rprintf(F," --inplace update destination files in-place (SEE MAN PAGE)\n");
rprintf(F," --append append data onto shorter files\n");
-@@ -590,7 +598,9 @@ static struct poptOption long_options[] = {
+@@ -591,7 +599,9 @@ static struct poptOption long_options[] = {
{"backup", 'b', POPT_ARG_VAL, &make_backups, 1, 0, 0 },
{"no-backup", 0, POPT_ARG_VAL, &make_backups, 0, 0, 0 },
{"backup-dir", 0, POPT_ARG_STRING, &backup_dir, 0, 0, 0 },
{"list-only", 0, POPT_ARG_VAL, &list_only, 2, 0, 0 },
{"read-batch", 0, POPT_ARG_STRING, &batch_name, OPT_READ_BATCH, 0, 0 },
{"write-batch", 0, POPT_ARG_STRING, &batch_name, OPT_WRITE_BATCH, 0, 0 },
-@@ -1402,6 +1412,8 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
+@@ -1404,6 +1414,8 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
tmpdir = sanitize_path(NULL, tmpdir, NULL, 0);
if (backup_dir)
backup_dir = sanitize_path(NULL, backup_dir, NULL, 0);
}
if (server_filter_list.head && !am_sender) {
struct filter_list_struct *elp = &server_filter_list;
-@@ -1419,6 +1431,14 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
- if (check_filter(elp, backup_dir, 1) < 0)
+@@ -1425,6 +1437,14 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
+ if (check_filter(elp, dir, 1) < 0)
goto options_rejected;
}
+ /* Clean backup_dir_dels same as for backup_dir */
}
if (!backup_suffix)
-@@ -1430,6 +1450,16 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
+@@ -1436,6 +1456,16 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
backup_suffix);
return 0;
}
if (backup_dir) {
backup_dir_len = strlcpy(backup_dir_buf, backup_dir, sizeof backup_dir_buf);
backup_dir_remainder = sizeof backup_dir_buf - backup_dir_len;
-@@ -1453,6 +1483,31 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
+@@ -1459,6 +1489,31 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
"P *%s", backup_suffix);
parse_rule(&filter_list, backup_dir_buf, 0, 0);
}
if (make_backups && !backup_dir) {
omit_dir_times = 0; /* Implied, so avoid -O to sender. */
-@@ -1844,6 +1899,10 @@ void server_options(char **args, int *argc_p)
+@@ -1852,6 +1907,10 @@ void server_options(char **args, int *argc_p)
args[ac++] = "--backup-dir";
args[ac++] = backup_dir;
}
/* Only send --suffix if it specifies a non-default value. */
if (strcmp(backup_suffix, backup_dir ? "" : BACKUP_SUFFIX) != 0) {
-@@ -1852,7 +1911,13 @@ void server_options(char **args, int *argc_p)
+@@ -1860,7 +1919,13 @@ void server_options(char **args, int *argc_p)
goto oom;
args[ac++] = arg;
}