summaryrefslogtreecommitdiffstats
path: root/tests/bfs
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-10-13 20:42:58 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-10-13 21:02:01 -0400
commitb89f22cbf250958a802915eb7b6bf0e5f38376ca (patch)
tree3eb0b29016e9807941ec9672fbd32e333982725d /tests/bfs
parent295ae76099e51ba579a6877af920c1f02f52cf7c (diff)
downloadbfs-b89f22cbf250958a802915eb7b6bf0e5f38376ca.tar.xz
color: Fix an infinite loop colorizing some invalid paths
Previously, given $ touch file $ ln -s file/file notdir $ bfs notdir/file bfs would loop forever when printing the error message, since it expected stripping the trailing slash from "notdir/" to fix the ENOTDIR error, but the broken symlink still gave the same error. Fixes: b4c3201 ("color: Only highlight the trailing slash on ENOTDIR")
Diffstat (limited to 'tests/bfs')
-rw-r--r--tests/bfs/color_notdir_slash_error.out0
-rw-r--r--tests/bfs/color_notdir_slash_error.sh2
2 files changed, 2 insertions, 0 deletions
diff --git a/tests/bfs/color_notdir_slash_error.out b/tests/bfs/color_notdir_slash_error.out
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/bfs/color_notdir_slash_error.out
diff --git a/tests/bfs/color_notdir_slash_error.sh b/tests/bfs/color_notdir_slash_error.sh
new file mode 100644
index 0000000..ca26d50
--- /dev/null
+++ b/tests/bfs/color_notdir_slash_error.sh
@@ -0,0 +1,2 @@
+# Regression test: infinite loop printing the error message for .../notdir/nowhere
+! bfs_diff -color links/notdir/nowhere