]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix false failure with spaces in hierarchy
authorPádraig Brady <P@draigBrady.com>
Mon, 4 May 2026 22:18:52 +0000 (23:18 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 4 May 2026 22:38:51 +0000 (23:38 +0100)
* tests/sort/sort-buffer-size.sh: Use `pwd` rather than $PWD,
and quote appropriately.
Reported by Bruno Haible.

tests/sort/sort-buffer-size.sh

index b25e270aacb10a43a2e5fb06d824d1da0c323abd..ed4b6c0d322e31960b1c620b5aa19c4039cce901 100755 (executable)
@@ -31,20 +31,22 @@ test "$rlimit" = 'unlimited' ||
 test "$(($rlimit/1024))" -gt 120 ||
   skip_ 'unable to determine enough resources available'
 
+cwd=$(pwd)
+
 # Without an explicit -S, sort should grow a pipe buffer enough to avoid
 # creating a temporary file for this input.
-tac exp | TMPDIR=$PWD/no-temp sort --parallel=1 > out || fail=1
+tac exp | TMPDIR="$cwd"/no-temp sort --parallel=1 > out || fail=1
 { test  -s out && compare exp out; } || fail=1
 
 # Check the same path when sort has precomputed key pointers in the
 # line table that must be adjusted after the buffer moves.
 sed 's/^/k /' exp > exp-key || framework_failure_
-tac exp-key | TMPDIR=$PWD/no-temp sort --parallel=1 -k2,2 > out || fail=1
+tac exp-key | TMPDIR="$cwd"/no-temp sort --parallel=1 -k2,2 > out || fail=1
 { test  -s out && compare exp-key out; } || fail=1
 
 # An explicit -S remains a limit for ordinary buffer growth, so this must
 # still need a temporary file and fail because TMPDIR is not a directory.
-returns_ 2 env TMPDIR=$PWD/no-temp \
+returns_ 2 env TMPDIR="$cwd"/no-temp \
   $SHELL -c 'tac exp | sort --parallel=1 -S 1M > small-out' || fail=1
 
 Exit $fail