summaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2022-08-08 18:30:43 -0700
committerWayne Davison <wayne@opencoder.net>2022-08-08 19:26:05 -0700
commit38e1b075b49664181a6b1727219b404debec035e (patch)
tree05421b48232a62928e9f351b085a071e90501144 /options.c
parentd659610afc8a3ee53fe68a8a4bbd7fc768fcd6e9 (diff)
downloadrsync-38e1b075b49664181a6b1727219b404debec035e.tar.gz
Fix some issues with backslashed wildcards in args.
Diffstat (limited to 'options.c')
-rw-r--r--options.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/options.c b/options.c
index 9731a144..a60ff515 100644
--- a/options.c
+++ b/options.c
@@ -2521,7 +2521,10 @@ char *safe_arg(const char *opt, const char *arg)
const char *f = arg;
char *t = ret + len1;
while (*f) {
- if (strchr(escapes, *f))
+ if (*f == '\\') {
+ if (!is_filename_arg || !strchr(WILD_CHARS, f[1]))
+ *t++ = '\\';
+ } else if (strchr(escapes, *f))
*t++ = '\\';
*t++ = *f++;
}