On Oct 14, 12:31am, jus...@specialbusservice.com (Justin Cormack) wrote: -- Subject: Re: CVS commit: src/tests/lib/libc/gen
| 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 / The part of the / inside a brace expression does not mention FNM_PATHNAME, and seems to be special. The whole thing is ambiguous and seems to try to document existing practice instead of what makes sense. christos