1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00
This commit is contained in:
Jakub Jelinek
2007-07-31 13:33:18 +00:00
parent d6220e9ee3
commit 32c075e1f0
448 changed files with 13841 additions and 10982 deletions

View File

@ -1,5 +1,5 @@
/* File tree walker functions.
Copyright (C) 1996-2003, 2004, 2006 Free Software Foundation, Inc.
Copyright (C) 1996-2003, 2004, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@ -348,8 +348,17 @@ open_dir_stream (int *dfdp, struct ftw_data *data, struct dir_data *dirp)
}
else
{
const char *name = ((data->flags & FTW_CHDIR)
? data->dirbuf + data->ftw.base: data->dirbuf);
const char *name;
if (data->flags & FTW_CHDIR)
{
name = data->dirbuf + data->ftw.base;
if (name[0] == '\0')
name = ".";
}
else
name = data->dirbuf;
dirp->stream = __opendir (name);
}
@ -721,9 +730,16 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors,
/* Get stat info for start directory. */
if (result == 0)
{
const char *name = ((data.flags & FTW_CHDIR)
? data.dirbuf + data.ftw.base
: data.dirbuf);
const char *name;
if (data.flags & FTW_CHDIR)
{
name = data.dirbuf + data.ftw.base;
if (name[0] == '\0')
name = ".";
}
else
name = data.dirbuf;
if (((flags & FTW_PHYS)
? LXSTAT (_STAT_VER, name, &st)