summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-02-14 14:40:23 -0500
committerTavian Barnes <tavianator@tavianator.com>2020-02-14 14:40:23 -0500
commit7b1c49bca18986e94d358d8ebb069dc01470be15 (patch)
treed744dd9c5727c2f14145c4e4ca726936c8132790 /eval.c
parentc7d3d9f6e2fd903788320dd7d0fedbf4c540c9f4 (diff)
downloadbfs-7b1c49bca18986e94d358d8ebb069dc01470be15.tar.xz
eval: Irregular files aren't empty
GNU find's -empty returns false for devices, sockets, etc., even though their st_size is 0. Match that behaviour.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 23c7b1b..010fef9 100644
--- a/eval.c
+++ b/eval.c
@@ -433,7 +433,7 @@ bool eval_empty(const struct expr *expr, struct eval_state *state) {
}
closedir(dir);
- } else {
+ } else if (ftwbuf->typeflag == BFTW_REG) {
const struct bfs_stat *statbuf = eval_stat(state);
if (statbuf) {
ret = statbuf->size == 0;