diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-10-02 12:57:26 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-10-02 12:57:26 -0400 |
commit | 9907004a1bb047e0644bf6d180aeb8b6ac23b1bb (patch) | |
tree | 72ece06cb49fc95ced7f76f8466a586c02797a4c /tests | |
parent | 52de184ba28551734e1cb13233588504ab5f62ec (diff) | |
download | bfs-9907004a1bb047e0644bf6d180aeb8b6ac23b1bb.tar.xz |
tests: Don't cd into paths longer than PATH_MAX
This fixes a warning on at least Alpine Linux that looks like
cd: error retrieving current directory: getcwd: cannot access parent directories: Filename too long
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/tests.sh | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/tests.sh b/tests/tests.sh index 66a79a8..121cd85 100755 --- a/tests/tests.sh +++ b/tests/tests.sh @@ -393,18 +393,14 @@ function make_deep() { local names="$name/$name/$name/$name" for i in {0..9} A B C D E F; do - ( - mkdir "$1/$i" - cd "$1/$i" - - # 4 * 1024 == 4096 == PATH_MAX - for _ in {1..4}; do - mkdir -p "$names" - cd "$names" - done - - "$XTOUCH" "$name" - ) + "$XTOUCH" -p "$1/$i/$name" + + # 4 * 1024 == 4096 == PATH_MAX + for _ in {1..4}; do + mv "$1/$i/$name" "$1/" + mkdir -p "$1/$i/$names" + mv "$1/$name" "$1/$i/$names/" + done done } make_deep "$TMP/deep" |