svn commit: r254091 - head/lib/libc/gen

Andrey A. Chernov ache at FreeBSD.org
Thu Aug 8 09:04:02 UTC 2013


Author: ache
Date: Thu Aug  8 09:04:02 2013
New Revision: 254091
URL: http://svnweb.freebsd.org/changeset/base/254091

Log:
  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

Modified:
  head/lib/libc/gen/fnmatch.c

Modified: head/lib/libc/gen/fnmatch.c
==============================================================================
--- head/lib/libc/gen/fnmatch.c	Thu Aug  8 06:15:58 2013	(r254090)
+++ head/lib/libc/gen/fnmatch.c	Thu Aug  8 09:04:02 2013	(r254091)
@@ -194,8 +194,6 @@ fnmatch1(pattern, string, stringstart, f
 				    &patmbs);
 				if (pclen == (size_t)-1 || pclen == (size_t)-2)
 					return (FNM_NOMATCH);
-				if (pclen == 0)
-					pc = '\\';
 				pattern += pclen;
 			}
 			/* FALLTHROUGH */


More information about the svn-src-head mailing list