From: Wayne Davison Date: Tue, 9 Aug 2022 00:36:36 +0000 (-0700) Subject: Handle a trailing "/." at the end of a source arg. X-Git-Tag: v3.2.5pre2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d659610afc8a3ee53fe68a8a4bbd7fc768fcd6e9;p=thirdparty%2Frsync.git Handle a trailing "/." at the end of a source arg. --- diff --git a/exclude.c b/exclude.c index e5991009..ca10b094 100644 --- a/exclude.c +++ b/exclude.c @@ -316,8 +316,11 @@ void add_implied_include(const char *arg) if (relative_paths) { if ((cp = strstr(arg, "/./")) != NULL) arg = cp + 3; - } else if ((cp = strrchr(arg, '/')) != NULL) + } else if ((cp = strrchr(arg, '/')) != NULL) { arg = cp + 1; + if (*arg == '.' && arg[1] == '\0') + arg++; + } arg_len = strlen(arg); if (arg_len) { if (strpbrk(arg, "*[?")) {