From c08f11b07c1e4a1cc30cade438adbdd4fefe5da2 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Thu, 8 Aug 2013 09:04:02 +0000 Subject: [PATCH] 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 --- lib/libc/gen/fnmatch.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c index c38aafc8b0b5..47d0a4131f5c 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 */