From: Wayne Davison Date: Sat, 5 Nov 2022 16:14:33 +0000 (-0700) Subject: Avoid quoting of tilde when it's a destination arg. X-Git-Tag: v3.3.0pre1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=537499408948f4e3dd048a861eb58f211e4546f8;p=thirdparty%2Frsync.git Avoid quoting of tilde when it's a destination arg. --- diff --git a/options.c b/options.c index d38bbe8d..cfa3e1dc 100644 --- a/options.c +++ b/options.c @@ -2510,7 +2510,7 @@ char *safe_arg(const char *opt, const char *arg) char *ret; if (!protect_args && old_style_args < 2 && (!old_style_args || (!is_filename_arg && opt != SPLIT_ARG_WHEN_OLD))) { const char *f; - if (!trust_sender_args && *arg == '~' + if (*arg == '~' && is_filename_arg && !am_sender && !trust_sender_args && ((relative_paths && !strstr(arg, "/./")) || !strchr(arg, '/'))) { extras++;