aboutsummaryrefslogtreecommitdiff
path: root/posix/glob.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-10-07 18:54:52 +0000
committerUlrich Drepper <drepper@redhat.com>2007-10-07 18:54:52 +0000
commitc8d48faef08fe72320394ebc5dc3d12059392b90 (patch)
tree37b30fef0de871969852467e4d7e2562853aabb3 /posix/glob.c
parenta1a363d20cb4d698af8e7a8a0bb9c3313fe7d858 (diff)
downloadglibc-c8d48faef08fe72320394ebc5dc3d12059392b90.zip
glibc-c8d48faef08fe72320394ebc5dc3d12059392b90.tar.gz
glibc-c8d48faef08fe72320394ebc5dc3d12059392b90.tar.bz2
[BZ #5103]
* posix/glob.c (glob): Recognize patterns starting \/. * posix/tst-gnuglob.c (find_file): Handle absolute path names. (main): Add test for pattern starting \/.
Diffstat (limited to 'posix/glob.c')
-rw-r--r--posix/glob.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/posix/glob.c b/posix/glob.c
index 6d8a891..6ae09ef 100644
--- a/posix/glob.c
+++ b/posix/glob.c
@@ -454,9 +454,10 @@ glob (pattern, flags, errfunc, pglob)
dirlen = 0;
}
}
- else if (filename == pattern)
+ else if (filename == pattern
+ || (filename == pattern + 1 && pattern[0] == '\\'))
{
- /* "/pattern". */
+ /* "/pattern" or "\\/pattern". */
dirname = "/";
dirlen = 1;
++filename;