[PATCH] Fix check for whitespace in $PATH or $HOME (in test script regress/ssh-tty.sh)
Jens Rosenboom
Jens.Rosenboom at web.de
Fri Sep 25 00:24:57 AEST 2026
This fixes the test for whitespace in $PATH or $HOME in regress/ssh-tty.sh.
*\t* seems to test for character 't', not for tab. In my case the check
was always true and the tests were always skipped.
[[:space:]] should do better and (according to chatgpt and claude) is
defined by POSIX.
---
regress/ssh-tty.sh | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/regress/ssh-tty.sh b/regress/ssh-tty.sh
index 07053d13b..fcfa27e44 100644
--- a/regress/ssh-tty.sh
+++ b/regress/ssh-tty.sh
@@ -10,8 +10,11 @@ FAKEHOME="$OBJ/.fakehome"
rm -rf "$FAKEHOME"
mkdir -m 0700 -p "$FAKEHOME"
-case "${PATH}${HOME}" in
-*\ *|*\t*) skip "\$PATH or \$HOME has whitespace, not supported in this
test";;
+case "${PATH}" in
+*[[:space:]]*) skip "\$PATH ($PATH) has whitespace, not supported in
this test";;
+esac
+case "${HOME}" in
+*[[:space:]]*) skip "\$HOME ($HOME) has whitespace, not supported in
this test";;
esac
# tmux stuff
--
2.55.0
More information about the openssh-unix-dev
mailing list