From 37d900d6279dce15e3f37a071f0d71c53e68ece9 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 5 Dec 2005 16:19:51 +0000 Subject: [PATCH] The client shouldn't send the --backup-dir-dels option to the server if the user didn't actually specify it. --- backup-dir-dels.diff | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/backup-dir-dels.diff b/backup-dir-dels.diff index 6248f47..5592699 100644 --- a/backup-dir-dels.diff +++ b/backup-dir-dels.diff @@ -157,7 +157,7 @@ Marc St-Onge else ok = do_rmdir(fname) == 0; if (ok) { ---- orig/options.c 2005-11-15 07:01:03 +--- orig/options.c 2005-11-15 18:21:22 +++ options.c 2005-11-07 04:35:54 @@ -132,10 +132,14 @@ int no_detach int write_batch = 0; @@ -203,7 +203,7 @@ Marc St-Onge {"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 }, -@@ -1139,6 +1149,8 @@ int parse_arguments(int *argc, const cha +@@ -1142,6 +1152,8 @@ int parse_arguments(int *argc, const cha partial_dir = sanitize_path(NULL, partial_dir, NULL, 0); if (backup_dir) backup_dir = sanitize_path(NULL, backup_dir, NULL, 0); @@ -212,7 +212,7 @@ Marc St-Onge } if (server_filter_list.head && !am_sender) { struct filter_list_struct *elp = &server_filter_list; -@@ -1173,6 +1185,14 @@ int parse_arguments(int *argc, const cha +@@ -1176,6 +1188,14 @@ int parse_arguments(int *argc, const cha return 0; } } @@ -227,7 +227,7 @@ Marc St-Onge } if (!backup_suffix) -@@ -1184,6 +1204,16 @@ int parse_arguments(int *argc, const cha +@@ -1187,6 +1207,16 @@ int parse_arguments(int *argc, const cha backup_suffix); return 0; } @@ -244,7 +244,7 @@ Marc St-Onge 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; -@@ -1205,6 +1235,31 @@ int parse_arguments(int *argc, const cha +@@ -1208,6 +1238,31 @@ int parse_arguments(int *argc, const cha "--suffix cannot be a null string without --backup-dir\n"); return 0; } @@ -276,18 +276,18 @@ Marc St-Onge if (make_backups && !backup_dir) omit_dir_times = 1; -@@ -1527,6 +1582,10 @@ void server_options(char **args,int *arg +@@ -1530,6 +1585,10 @@ void server_options(char **args,int *arg args[ac++] = "--backup-dir"; args[ac++] = backup_dir; } -+ if (backup_dir_dels) { ++ if (backup_dir_dels && backup_dir_dels != backup_dir) { + args[ac++] = "--backup-dir-dels"; + args[ac++] = backup_dir_dels; + } /* Only send --suffix if it specifies a non-default value. */ if (strcmp(backup_suffix, backup_dir ? "" : BACKUP_SUFFIX) != 0) { -@@ -1535,7 +1594,13 @@ void server_options(char **args,int *arg +@@ -1538,7 +1597,13 @@ void server_options(char **args,int *arg goto oom; args[ac++] = arg; } -- 2.34.1