mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-05-19 20:35:50 -04:00
Fix handling of a character class with an escaped closing bracket.
This commit is contained in:
@@ -424,9 +424,10 @@ void add_implied_include(const char *arg, int skip_daemon_module)
|
||||
for (cp = arg; *cp; ) {
|
||||
switch (*cp) {
|
||||
case '\\':
|
||||
if (cp[1] == ']')
|
||||
cp++; /* A \] in a filter might cause a problem w/o wildcards. */
|
||||
else if (!strchr("*[?", cp[1])) {
|
||||
if (cp[1] == ']') {
|
||||
if (!saw_wild)
|
||||
cp++; /* A \] in a non-wild filter causes a problem, so drop the \ . */
|
||||
} else if (!strchr("*[?", cp[1])) {
|
||||
backslash_cnt++;
|
||||
if (saw_wild)
|
||||
*p++ = '\\';
|
||||
|
||||
Reference in New Issue
Block a user