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 libc/10278] New: glob() gives inconsistent results with trailing "/"


The POSIX spec doesn't specify exactly what should happen with a pattern ending
in "/"; all it says about slashes in patterns is:

The slash character in a pathname shall be explicitly matched by using one or
more slashes in the pattern; it shall neither be matched by the asterisk or
question-mark special characters nor by a bracket expression.

All shells I'm aware of interpret this to mean that if your glob expression ends
with a "/", it should match only directories.  GNU glob() handles this correctly
for simple globbing expressions like "*/", but for other expressions like
"dir/*/", "/*/", etc. it returns all directories with a trailing slash, AND all
files without a trailing slash.

I believe this inconsistent behavior is a bug.

See also GNU make bug #18123 http://savannah.gnu.org/bugs/index.php?18123

-- 
           Summary: glob() gives inconsistent results with trailing "/"
           Product: glibc
           Version: 2.8
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: psmith at gnu dot org
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=10278

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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