summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eval.c2
-rwxr-xr-xtests.sh6
-rw-r--r--tests/test_empty_special.out14
3 files changed, 20 insertions, 2 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;
diff --git a/tests.sh b/tests.sh
index d1c5413..2a52049 100755
--- a/tests.sh
+++ b/tests.sh
@@ -432,7 +432,7 @@ gnu_tests=(
test_depth_maxdepth_2
test_empty
-
+ test_empty_special
test_exec_nothing
test_exec_substring
@@ -1106,6 +1106,10 @@ function test_empty() {
bfs_diff basic -empty
}
+function test_empty_special() {
+ bfs_diff rainbow -empty
+}
+
function test_gid() {
bfs_diff basic -gid "$(id -g)"
}
diff --git a/tests/test_empty_special.out b/tests/test_empty_special.out
new file mode 100644
index 0000000..3927f2b
--- /dev/null
+++ b/tests/test_empty_special.out
@@ -0,0 +1,14 @@
+rainbow/exec.sh
+rainbow/file.dat
+rainbow/file.txt
+rainbow/mh1
+rainbow/mh2
+rainbow/ow
+rainbow/sgid
+rainbow/star.gz
+rainbow/star.tar
+rainbow/star.tar.gz
+rainbow/sticky
+rainbow/sticky_ow
+rainbow/sugid
+rainbow/suid