public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/10278] New: glob() gives inconsistent results with trailing "/"
@ 2009-06-13 21:56 psmith at gnu dot org
0 siblings, 0 replies; only message in thread
From: psmith at gnu dot org @ 2009-06-13 21:56 UTC (permalink / raw)
To: glibc-bugs
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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-06-13 21:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-13 21:56 [Bug libc/10278] New: glob() gives inconsistent results with trailing "/" psmith at gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).