On Mon, Oct 13, 2014 at 2:26 PM, Christos Zoulas <chris...@zoulas.com> wrote: > On Oct 13, 2:23pm, jus...@specialbusservice.com (Justin Cormack) wrote: > -- Subject: Re: CVS commit: src/tests/lib/libc/gen > > | You can have a ] by having it as the first character that is made explicit. > | And if the / is not special then that is no problem either. > > Yes, '/' is the problem. > > | Let me read through the spec again. We are not alone in not passing this > | test eg glibc). I can't remember what FreeBSD does will check again. > > I couldn't find a place where it said how to quote /.
Well also there is the bit thats says http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_13_01 When pattern matching is used where shell quote removal is not performed (such as in the argument to the find - name primary when find is being called using one of the exec functions as defined in the System Interfaces volume of IEEE Std 1003.1-2001, or in the pattern argument to the fnmatch() function), special characters can be escaped to remove their special meaning by preceding them with a backslash character. This escaping backslash is discarded. The sequence "\\" represents one literal backslash. All of the requirements and effects of quoting on ordinary, shell special, and special pattern characters shall apply to escaping in this context. Which seems to suggest your change is correct... will see if can get agreement. The / handling for fnmatch seems to be covered by http://pubs.opengroup.org/onlinepubs/009695399/functions/fnmatch.html The flags argument shall modify the interpretation of pattern and string. It is the bitwise-inclusive OR of zero or more of the flags defined in <fnmatch.h>. If the FNM_PATHNAME flag is set in flags, then a slash character ( '/' ) in string shall be explicitly matched by a slash in pattern; it shall not be matched by either the asterisk or question-mark special characters, nor by a bracket expression. If the FNM_PATHNAME flag is not set, the slash character shall be treated as an ordinary character. Which suggests \/ is not allowed, you are matching pathnames or not and cannot escape a / Justin