commit: 6df795f43243d0a1e27af5546059acb4c36d80b4
parent 255a209ba439ae1a61e3ff354013d3d8346934a7
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Tue, 30 Jul 2024 09:55:29 +0200
test-cmd/pwd.sh: rely on saved $PWD rather than non-portable ~-
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test-cmd/pwd.sh b/test-cmd/pwd.sh
@@ -17,11 +17,12 @@ if command -v mktemp >/dev/null 2>/dev/null
then
tmpdir="$(mktemp -d)" || exit 1
test -d "$tmpdir" || exit 1
+ oldpwd="$PWD"
cd "$tmpdir" || exit 1
rm -fr "$tmpdir" || exit 1
t --exit=1 enoent '' 'pwd: getcwd: No such file or directory
'
- cd ~-
+ cd "$oldpwd"
else
skip enoent 'requires mktemp(1)'
fi