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 */
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to