This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/1062] New: sysdeps/generic/glob.c merge from gnulib (part 3 of 3)
- From: "eggert at gnu dot org" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 12 Jul 2005 07:15:02 -0000
- Subject: [Bug libc/1062] New: sysdeps/generic/glob.c merge from gnulib (part 3 of 3)
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
Attached is the most interesting of the 3 patches. It contains (1) an
efficiency improvement and (2) a related bug fix.
1. Moves the check for GLOB_MARK directory status (and the append of
`/') into glob_in_dir, where it is more efficient than performing
a second pass through the data and sometimes calling stat a second
time on each file or directory. All calls to stat are avoided
when dirent->d_type is available. No call to realloc of the
directory name is ever necessary since room for the slash can be
allocated in the first pass.
2. Ignores broken links only when GLOB_ONLYDIR is set. With glibc
versions 2.3.3 through 2.3.5, the following in an empty directory
would return nothing:
ln -s doesnt-exist linkname
glob ("*", ...)
This fix syncs with the comments in the file, syncs with the
POSIX 1003.2 spec, syncs with the BSD behavior, restores the
pre-glibc-2.3.3 behavior, and simply makes more sense - why should
`rm *' fail to remove broken links? This certainly deviates from
historical practice and the behavior most likely expected by a
user.
There is further discussion of this issue and why this is the
correct fix here:
<http://lists.gnu.org/archive/html/bug-cvs/2005-06/msg00004.html>
and here:
<https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=126460>.
--
Summary: sysdeps/generic/glob.c merge from gnulib (part 3 of 3)
Product: glibc
Version: 2.3.5
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: gotom at debian dot or dot jp
ReportedBy: eggert at gnu dot org
CC: glibc-bugs at sources dot redhat dot com
http://sources.redhat.com/bugzilla/show_bug.cgi?id=1062
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.