Change the way we pass the --suffix option to the remote process so
authorWayne Davison <wayned@samba.org>
Fri, 1 Aug 2003 20:19:51 +0000 (20:19 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 1 Aug 2003 20:19:51 +0000 (20:19 +0000)
that a string that starts with ~ doesn't get modified.

options.c

index a4111ca..2dd0da4 100644 (file)
--- a/options.c
+++ b/options.c
@@ -826,8 +826,12 @@ void server_options(char **args,int *argc)
 
        /* Only send --suffix if it specifies a non-default value. */
        if (strcmp(backup_suffix, backup_dir? "" : BACKUP_SUFFIX) != 0) {
-               args[ac++] = "--suffix";
-               args[ac++] = backup_suffix;
+               char *s = malloc(9+backup_suffix_len+1);
+               if (!s)
+                       out_of_memory("server_options");
+               /* We use the following syntax to avoid weirdness with '~'. */
+               sprintf(s, "--suffix=%s", backup_suffix);
+               args[ac++] = s;
        }
 
        if (delete_mode && !delete_excluded)