diff options
author | Wayne Davison <wayned@samba.org> | 2003-08-01 20:19:51 +0000 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2003-08-01 20:19:51 +0000 |
commit | 191e40da17f9139cb702c48a7d708a4563ccc0c2 (patch) | |
tree | 82721b3f3bcb7a75306f4cbc82d2b393a27115f3 | |
parent | 80ddadb7e8cf689baacfd5cd97edcb9d9540e77e (diff) | |
download | rsync-191e40da17f9139cb702c48a7d708a4563ccc0c2.tar.gz |
Change the way we pass the --suffix option to the remote process so
that a string that starts with ~ doesn't get modified.
-rw-r--r-- | options.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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) |