From 6a87697239310dd529781d9db1ee705eeaa5405e Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 30 Sep 2004 09:05:55 +0000 Subject: Updated to fedora-glibc-20040930T0838 --- posix/tst-gnuglob.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'posix/tst-gnuglob.c') 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 -/* #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; } -- cgit 1.4.1