This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug glob/23926] New: fnmatch with FNM_PATHNAME is not POSIX compliant


https://sourceware.org/bugzilla/show_bug.cgi?id=23926

            Bug ID: 23926
           Summary: fnmatch with FNM_PATHNAME is not POSIX compliant
           Product: glibc
           Version: 2.28
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: glob
          Assignee: unassigned at sourceware dot org
          Reporter: cykerway at gmail dot com
  Target Milestone: ---

Created attachment 11414
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11414&action=edit
test case

POSIX 2008 says, in 2.13.3 Patterns Used for Filename Expansion:

<http://pubs.opengroup.org/onlinepubs/9699919799.2008edition/>

>   The <slash> character in a pathname shall be explicitly matched by using one or more <slash> characters in the pattern; it shall neither be matched by the <asterisk> or <question-mark> special characters nor by a bracket expression. <slash> characters in the pattern shall be identified before bracket expressions; thus, a <slash> cannot be included in a pattern bracket expression used for filename expansion. If a <slash> character is found following an unescaped <left-square-bracket> character before a corresponding <right-square-bracket> is found, the open bracket shall be treated as an ordinary character. For example, the pattern "a[b/c]d" does not match such pathnames as abd or a/d. It only matches a pathname of literally a[b/c]d.

But fnmatch (with FNM_PATHNAME) matches pattern `a[b/c]d` with string `abd` not
`a[b/c]d`.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]