Allow ~/remote/./path with -R if the path has /./ in it.
authorWayne Davison <wayne@opencoder.net>
Tue, 16 Aug 2022 01:18:11 +0000 (18:18 -0700)
committerWayne Davison <wayne@opencoder.net>
Tue, 16 Aug 2022 01:55:05 +0000 (18:55 -0700)
options.c

index 4feeb7e0e47438d40f095ab972dfc045f997fdd9..5b3d6dea92de69ca32a65c178a412d812b5a6b72 100644 (file)
--- a/options.c
+++ b/options.c
@@ -2508,7 +2508,9 @@ 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 == '~' && (relative_paths || !strchr(arg, '/'))) {
+               if (!trust_sender_args && *arg == '~'
+                && ((relative_paths && !strstr(arg, "/./"))
+                 || !strchr(arg, '/'))) {
                        extras++;
                        escape_leading_tilde = 1;
                }