From 3529cc45cb25630a109cb650d5813a1f2ba405cb Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 11 Jul 2018 23:59:10 -0400 Subject: eval: Fix -delete when following symlinks. Same bug as https://savannah.gnu.org/bugs/?46305. Please don't ever do this though. --- tests.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests.sh') diff --git a/tests.sh b/tests.sh index b74e067..3e47374 100755 --- a/tests.sh +++ b/tests.sh @@ -266,6 +266,7 @@ bsd_tests=( test_ok_stdin test_okdir_stdin test_delete + test_L_delete test_rm test_regex test_iregex @@ -369,6 +370,7 @@ gnu_tests=( test_perm_symbolic_slash test_perm_leading_plus_symbolic_slash test_delete + test_L_delete test_regex test_iregex test_regex_parens @@ -1177,6 +1179,18 @@ function test_delete() { bfs_diff scratch } +function test_L_delete() { + rm -rf scratch/* + mkdir scratch/foo + mkdir scratch/bar + ln -s ../foo scratch/bar/baz + + # Don't try to rmdir() a symlink + invoke_bfs -L scratch/bar -delete || return 1 + + bfs_diff scratch +} + function test_rm() { rm -rf scratch/* touchp scratch/foo/bar/baz -- cgit v1.2.3