Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Aug 2013 09:04:02 +0000 (UTC)
From:      "Andrey A. Chernov" <ache@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254091 - head/lib/libc/gen
Message-ID:  <201308080904.r78942Pp075760@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308080904.r78942Pp075760>