summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2013-08-08 09:04:02 +0000
committerache <ache@FreeBSD.org>2013-08-08 09:04:02 +0000
commit0a3b2e376d150258c8294c12a85bec99546ab84b (patch)
tree7f5755d9b2b46c645a62c0fe478b9e77ddd90ff3
parent3024a234e9051e9331e2728ba554e1f28ba85d26 (diff)
downloadFreeBSD-src-0a3b2e376d150258c8294c12a85bec99546ab84b.zip
FreeBSD-src-0a3b2e376d150258c8294c12a85bec99546ab84b.tar.gz
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
-rw-r--r--lib/libc/gen/fnmatch.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c
index c38aafc..47d0a41 100644
--- a/lib/libc/gen/fnmatch.c
+++ b/lib/libc/gen/fnmatch.c
@@ -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 */
OpenPOWER on IntegriCloud