From 7b1c49bca18986e94d358d8ebb069dc01470be15 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 14 Feb 2020 14:40:23 -0500 Subject: 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. --- eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'eval.c') 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; -- cgit v1.2.3