summaryrefslogtreecommitdiffstats
path: root/bftw.c
diff options
context:
space:
mode:
Diffstat (limited to 'bftw.c')
-rw-r--r--bftw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bftw.c b/bftw.c
index 991176a..baf7e65 100644
--- a/bftw.c
+++ b/bftw.c
@@ -836,7 +836,7 @@ static void bftw_init_buffers(struct bftw_state *state, const struct dirent *de)
|| (ftwbuf->typeflag == BFTW_LNK && follow)
|| (ftwbuf->typeflag == BFTW_DIR && (detect_cycles || xdev))) {
int ret = ftwbuf_stat(ftwbuf, &state->statbuf);
- if (ret != 0 && follow && errno == ENOENT) {
+ if (ret != 0 && follow && (errno == ENOENT || errno == ENOTDIR)) {
// Could be a broken symlink, retry without following
ftwbuf->at_flags = AT_SYMLINK_NOFOLLOW;
ret = ftwbuf_stat(ftwbuf, &state->statbuf);