From nobody@FreeBSD.org  Thu Aug  8 03:46:30 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 3FBB2F45
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  8 Aug 2013 03:46:30 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 13CE820DD
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  8 Aug 2013 03:46:30 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r783kTCe022422
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 8 Aug 2013 03:46:29 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r783kT6B022421;
	Thu, 8 Aug 2013 03:46:29 GMT
	(envelope-from nobody)
Message-Id: <201308080346.r783kT6B022421@oldred.freebsd.org>
Date: Thu, 8 Aug 2013 03:46:29 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: fnmatch doesn't translate "\\"
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         181129
>Category:       bin
>Synopsis:       fnmatch doesn't translate "\\"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ache
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 08 03:50:00 UTC 2013
>Closed-Date:    Thu Aug 15 09:03:43 UTC 2013
>Last-Modified:  Fri Aug 30 10:20:00 UTC 2013
>Originator:     Garrett Cooper
>Release:        10-CURRENT
>Organization:
EMC Isilon
>Environment:
FreeBSD fuji-current.local 10.0-CURRENT FreeBSD 10.0-CURRENT #10 c9d2bd6-dirty: Wed Aug  7 18:55:03 PDT 2013     root@fuji-current.local:/usr/obj/usr/src/sys/FUJI-NOCOMPAT  i386
>Description:
fnmatch("\\", "\\", 0);

should work, but instead it returns FNM_NOMATCH. See http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=41558 for more details.
>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ache 
Responsible-Changed-By: ache 
Responsible-Changed-When: Thu Aug 8 08:29:22 UTC 2013 
Responsible-Changed-Why:  
Take 

http://www.freebsd.org/cgi/query-pr.cgi?pr=181129 
State-Changed-From-To: open->patched 
State-Changed-By: ache 
State-Changed-When: Thu Aug 8 09:08:35 UTC 2013 
State-Changed-Why:  
Committed into -current 

http://www.freebsd.org/cgi/query-pr.cgi?pr=181129 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/181129: commit references a PR
Date: Thu,  8 Aug 2013 09:04:15 +0000 (UTC)

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/181129: commit references a PR
Date: Sun, 11 Aug 2013 21:54:38 +0000 (UTC)

 Author: jilles
 Date: Sun Aug 11 21:54:20 2013
 New Revision: 254231
 URL: http://svnweb.freebsd.org/changeset/base/254231
 
 Log:
   fnmatch(): Add test for r254091 (pattern with single backslash).
   
   This test cannot be converted to an sh(1) test because the syntax would be
   invalid.
   
   PR:		181129
   MFC after:	1 week
 
 Modified:
   head/tools/regression/lib/libc/gen/test-fnmatch.c
 
 Modified: head/tools/regression/lib/libc/gen/test-fnmatch.c
 ==============================================================================
 --- head/tools/regression/lib/libc/gen/test-fnmatch.c	Sun Aug 11 21:46:06 2013	(r254230)
 +++ head/tools/regression/lib/libc/gen/test-fnmatch.c	Sun Aug 11 21:54:20 2013	(r254231)
 @@ -135,6 +135,8 @@ struct testcase {
  	"\\[", "\\[", 0, FNM_NOMATCH,
  	"\\(", "\\(", 0, FNM_NOMATCH,
  	"\\a", "\\a", 0, FNM_NOMATCH,
 +	"\\", "\\", 0, FNM_NOMATCH,
 +	"\\", "", 0, 0,
  	"\\*", "\\*", FNM_NOESCAPE, 0,
  	"\\?", "\\?", FNM_NOESCAPE, 0,
  	"\\", "\\", FNM_NOESCAPE, 0,
 @@ -236,6 +238,8 @@ write_sh_tests(const char *progname, int
  		if (strchr(t->pattern, '\'') != NULL ||
  		    strchr(t->string, '\'') != NULL)
  			continue;
 +		if (t->flags == 0 && strcmp(t->pattern, "\\") == 0)
 +			continue;
  		if (num == 1 && t->flags == 0)
  			printf("test%smatch '%s' '%s'\n",
  			    t->result == FNM_NOMATCH ? "no" : "",
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/181129: commit references a PR
Date: Thu, 15 Aug 2013 05:20:00 +0000 (UTC)

 Author: ache
 Date: Thu Aug 15 04:27:10 2013
 New Revision: 254353
 URL: http://svnweb.freebsd.org/changeset/base/254353
 
 Log:
   MFC: r254091
   
   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
 
 Modified:
   stable/9/lib/libc/gen/fnmatch.c
 Directory Properties:
   stable/9/lib/libc/   (props changed)
 
 Modified: stable/9/lib/libc/gen/fnmatch.c
 ==============================================================================
 --- stable/9/lib/libc/gen/fnmatch.c	Thu Aug 15 04:25:16 2013	(r254352)
 +++ stable/9/lib/libc/gen/fnmatch.c	Thu Aug 15 04:27:10 2013	(r254353)
 @@ -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 */
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: ache 
State-Changed-When: Thu Aug 15 09:03:15 UTC 2013 
State-Changed-Why:  
Committed into -stable 

http://www.freebsd.org/cgi/query-pr.cgi?pr=181129 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/181129: commit references a PR
Date: Fri, 30 Aug 2013 10:10:29 +0000 (UTC)

 Author: jilles
 Date: Fri Aug 30 10:10:22 2013
 New Revision: 255066
 URL: http://svnweb.freebsd.org/changeset/base/255066
 
 Log:
   MFC r254231: fnmatch(): Add test for r254353 (pattern with single backslash)
   
   This test cannot be converted to an sh(1) test because the syntax would be
   invalid.
   
   r254091 was merged to stable/9 as r254353.
   
   PR:		181129
 
 Modified:
   stable/9/tools/regression/lib/libc/gen/test-fnmatch.c
 Directory Properties:
   stable/9/tools/regression/lib/libc/   (props changed)
 
 Modified: stable/9/tools/regression/lib/libc/gen/test-fnmatch.c
 ==============================================================================
 --- stable/9/tools/regression/lib/libc/gen/test-fnmatch.c	Fri Aug 30 10:07:10 2013	(r255065)
 +++ stable/9/tools/regression/lib/libc/gen/test-fnmatch.c	Fri Aug 30 10:10:22 2013	(r255066)
 @@ -135,6 +135,8 @@ struct testcase {
  	"\\[", "\\[", 0, FNM_NOMATCH,
  	"\\(", "\\(", 0, FNM_NOMATCH,
  	"\\a", "\\a", 0, FNM_NOMATCH,
 +	"\\", "\\", 0, FNM_NOMATCH,
 +	"\\", "", 0, 0,
  	"\\*", "\\*", FNM_NOESCAPE, 0,
  	"\\?", "\\?", FNM_NOESCAPE, 0,
  	"\\", "\\", FNM_NOESCAPE, 0,
 @@ -236,6 +238,8 @@ write_sh_tests(const char *progname, int
  		if (strchr(t->pattern, '\'') != NULL ||
  		    strchr(t->string, '\'') != NULL)
  			continue;
 +		if (t->flags == 0 && strcmp(t->pattern, "\\") == 0)
 +			continue;
  		if (num == 1 && t->flags == 0)
  			printf("test%smatch '%s' '%s'\n",
  			    t->result == FNM_NOMATCH ? "no" : "",
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
