diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2016-08-24 10:15:11 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2016-08-24 11:10:59 -0400 |
commit | ac2f808a1bda94f79c2e6553ef44077e39124d25 (patch) | |
tree | 655ab5ef749c936f71c81af4b6acc343f5d65d96 | |
parent | 8395589d15961cedc136a0cf945bd5ae93b5c7c6 (diff) | |
download | bfs-ac2f808a1bda94f79c2e6553ef44077e39124d25.tar.xz |
bftw: Initialize typeflag to BFTW_UNKNOWN.
It was totally broken on filesystems that spit out DT_UNKNOWN.
-rw-r--r-- | bftw.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -688,12 +688,11 @@ static void bftw_init_buffers(struct bftw_state *state, const struct dirent *de) ftwbuf->depth = 0; } + ftwbuf->typeflag = BFTW_UNKNOWN; if (de) { ftwbuf_use_dirent(ftwbuf, de); } else if (state->status != BFTW_CHILD) { ftwbuf->typeflag = BFTW_DIR; - } else { - ftwbuf->typeflag = BFTW_UNKNOWN; } bool follow = state->flags & (current ? BFTW_FOLLOW_NONROOT : BFTW_FOLLOW_ROOT); |