mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
Update.
* io/ftwtest-sh: Add test case for relative path with /. at the end. 2003-01-12 Jim Meyering <jim@meyering.net> * io/ftw.c (ftw_startup): When trying to stat the starting directory, use the basename if we've already chdir'd into its parent directory. 2003-01-12 Ulrich Drepper <drepper@redhat.com> to change directory after call to ftw_dir.
This commit is contained in:
10
io/ftw.c
10
io/ftw.c
@@ -358,7 +358,7 @@ process_entry (struct ftw_data *data, struct dir_data *dir, const char *name,
|
||||
}
|
||||
else
|
||||
if (__chdir ("..") < 0)
|
||||
result = 1;
|
||||
result = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -584,9 +584,13 @@ 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);
|
||||
|
||||
if (((flags & FTW_PHYS)
|
||||
? LXSTAT (_STAT_VER, data.dirbuf, &st)
|
||||
: XSTAT (_STAT_VER, data.dirbuf, &st)) < 0)
|
||||
? LXSTAT (_STAT_VER, name, &st)
|
||||
: XSTAT (_STAT_VER, name, &st)) < 0)
|
||||
{
|
||||
if (!(flags & FTW_PHYS)
|
||||
&& errno == ENOENT
|
||||
|
||||
Reference in New Issue
Block a user