diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2018-07-11 23:59:10 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2018-07-12 00:36:52 -0400 |
commit | 3529cc45cb25630a109cb650d5813a1f2ba405cb (patch) | |
tree | f143ca063614f86e90b7856a186c64678aff300d /tests.sh | |
parent | f25efd83a941d143dff939d353113415b3a7fa90 (diff) | |
download | bfs-3529cc45cb25630a109cb650d5813a1f2ba405cb.tar.xz |
eval: Fix -delete when following symlinks.
Same bug as https://savannah.gnu.org/bugs/?46305. Please don't ever do
this though.
Diffstat (limited to 'tests.sh')
-rwxr-xr-x | tests.sh | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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 |