summaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-09-30 09:05:55 +0000
committerJakub Jelinek <jakub@redhat.com>2004-09-30 09:05:55 +0000
commit6a87697239310dd529781d9db1ee705eeaa5405e (patch)
treed89bd4ede05cf7918178e39da5950535725717d8 /posix
parentbd307f4e23f985b55276724a00f88e07309e68be (diff)
downloadglibc-6a87697239310dd529781d9db1ee705eeaa5405e.tar.gz
Updated to fedora-glibc-20040930T0838cvs/fedora-glibc-2_3_3-61
Diffstat (limited to 'posix')
-rw-r--r--posix/tst-gnuglob.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/posix/tst-gnuglob.c b/posix/tst-gnuglob.c
index b15dad12ef..72f3fa4a3e 100644
--- a/posix/tst-gnuglob.c
+++ b/posix/tst-gnuglob.c
@@ -30,7 +30,7 @@
#include <sys/stat.h>
-/* #define DEBUG */
+// #define DEBUG
#ifdef DEBUG
# define PRINTF(fmt, args...) printf (fmt, ##args)
#else
@@ -106,6 +106,9 @@ find_file (const char *s)
if (strcmp (s, ".") == 0)
return 0;
+ if (s[0] == '.' && s[1] == '/')
+ s += 2;
+
while (*s != '\0')
{
char *endp = strchrnul (s, '/');
@@ -126,6 +129,10 @@ find_file (const char *s)
errno = ENOENT;
return -1;
}
+
+ if (*endp == '\0')
+ return idx + 1;
+
if (filesystem[idx].type != DT_DIR
&& (idx + 1 >= nfiles
|| filesystem[idx].level >= filesystem[idx + 1].level))
@@ -136,9 +143,6 @@ find_file (const char *s)
++idx;
- if (*endp == '\0')
- return idx;
-
s = endp + 1;
++level;
}