diff options
| author | Rich Felker <dalias@aerifal.cx> | 2026-09-21 09:15:22 -0400 |
|---|---|---|
| committer | Rich Felker <dalias@aerifal.cx> | 2026-09-21 09:15:22 -0400 |
| commit | c4e1bb3994c14ed5112c894d15a451bf00f0d501 (patch) | |
| tree | e1d628db0ce713d5d2076d83e3fa75ca0a1088a4 | |
| parent | be5ba5695df9197365cdb1c95b12fa423059ce34 (diff) | |
| download | musl-master.tar.gz | |
the new condition also allows forward progress into ordinary matching
if the pattern begins with a backslash. this is fine independent of
FNM_NOESCAPE and independent of what follows the backslash; if
FNM_NOESCAPE is active, the backslash is literal and will not match.
if FNM_NOESCAPE is not active, the pattern beginning with a backslash
ensures that the first character is literal.
| -rw-r--r-- | src/regex/fnmatch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/regex/fnmatch.c b/src/regex/fnmatch.c index 978fff88..ae3c1c24 100644 --- a/src/regex/fnmatch.c +++ b/src/regex/fnmatch.c @@ -168,7 +168,7 @@ static int fnmatch_internal(const char *pat, size_t m, const char *str, size_t n int c, k, kfold; if (flags & FNM_PERIOD) { - if (*str == '.' && *pat != '.') + if (*str == '.' && *pat != '.' && *pat != '\\') return FNM_NOMATCH; } for (;;) { |
