diff options
author | Jim Meyering <jim@meyering.net> | 2003-02-08 17:07:38 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-02-08 17:07:38 +0000 |
commit | f99cc7ac67856c66c751442f524f530fcde6f344 (patch) | |
tree | 0bf62304f889e4f101f4090862de1aa2a3e4abb0 | |
parent | 14608aae3cee38c81af6c5dbe2c006910e3ea558 (diff) | |
download | coreutils-f99cc7ac67856c66c751442f524f530fcde6f344.tar.xz |
(ftw_startup): When using FTW_CHDIR, always remember
the current directory, not just when DIR contains a slash.
-rw-r--r-- | lib/ftw.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -691,13 +691,13 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors, data.known_objects = NULL; /* Now go to the directory containing the initial file/directory. */ - if ((flags & FTW_CHDIR) && data.ftw.base > 0) + if (flags & FTW_CHDIR) { /* GNU extension ahead. */ cwd = __getcwd (NULL, 0); if (cwd == NULL) result = -1; - else + else if (data.ftw.base > 0) { /* Change to the directory the file is in. In data.dirbuf we have a writable copy of the file name. Just NUL |