According to POSIX \ in the fnmatch(3) pattern should escape
any character including '\0', but our version replace escaped '\0' with '\\'. I.e. fnmatch("\\", "\\", 0) should not match while fnmatch("\\", "", 0) should (Linux and NetBSD does the same). Was vice versa. PR: 181129 MFC after: 1 week
This commit is contained in:
parent
4030a4b2a3
commit
c08f11b07c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=254091
@ -194,8 +194,6 @@ fnmatch1(pattern, string, stringstart, flags, patmbs, strmbs)
|
||||
&patmbs);
|
||||
if (pclen == (size_t)-1 || pclen == (size_t)-2)
|
||||
return (FNM_NOMATCH);
|
||||
if (pclen == 0)
|
||||
pc = '\\';
|
||||
pattern += pclen;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
|
Loading…
Reference in New Issue
Block a user