From 289f56cd4cfd554f9ed2406fb1a6fdb82d53ab4e Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Sat, 13 Jun 2020 01:48:13 +0200 Subject: [PATCH] tests/pty.sh: fix regress fail due to $TMPDIR Test 137(C) was failing on some systems because $TMPDIR was set and the local vi(1) honours it, so that the expected '/tmp/' string was never output by vi. For compatibility with vi programs that honour $TMPDIR and those that always use /tmp, we must export TMPDIR=/tmp. src/cmd/ksh93/tests/pty.sh: - Export TMPDIR=/tmp for test 137(C). Note that this exports TMPDIR to the environment for the duration of the 'tst' function run because the function was defined using the ksh 'function tst { ...; }' syntax. --- src/cmd/ksh93/tests/pty.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cmd/ksh93/tests/pty.sh b/src/cmd/ksh93/tests/pty.sh index 71eaef5bd..1ccf523d7 100755 --- a/src/cmd/ksh93/tests/pty.sh +++ b/src/cmd/ksh93/tests/pty.sh @@ -19,6 +19,13 @@ ######################################################################## : : generated by mkptytests from "posix-sh-*-c.pty" : : +# These are tests for the interactive shell, run in a pseudoterminal utility +# called 'pty', which allows for scripting interactive sessions and which is +# installed in arch/*/bin while building. To understand these tests, first +# read the pty manual by running: arch/*/bin/pty --man + +# The # err_exit # comments are to enable shtests to count the tests. + # the trickiest part of the tests is avoiding typeahead # in the pty dialogue @@ -363,7 +370,7 @@ r history ! # err_exit # -tst $LINENO <<"!" +TMPDIR=/tmp tst $LINENO <<"!" L POSIX sh 137(C) # If the User Portability Utilities Option is supported and shell