git: ead0fe475c5e - stable/13 - sh: nullify ENV in tests

From: Piotr Pawel Stefaniak <pstef_at_FreeBSD.org>
Date: Wed, 24 Aug 2022 18:22:24 UTC
The branch stable/13 has been updated by pstef:

URL: https://cgit.FreeBSD.org/src/commit/?id=ead0fe475c5e30a94e01cead919a2f1e4bc38c3b

commit ead0fe475c5e30a94e01cead919a2f1e4bc38c3b
Author:     Piotr Pawel Stefaniak <pstef@FreeBSD.org>
AuthorDate: 2022-08-20 10:16:18 +0000
Commit:     Piotr Pawel Stefaniak <pstef@FreeBSD.org>
CommitDate: 2022-08-24 18:21:08 +0000

    sh: nullify ENV in tests
    
    This is to avoid loading .shrc which may contain commands that would
    result in output different than expected.
    
    (cherry picked from commit a1423456415ad4784b31513cfe11438d2446881f)
---
 bin/sh/tests/builtins/cd10.0      | 2 +-
 bin/sh/tests/builtins/fc1.0       | 2 +-
 bin/sh/tests/execution/int-cmd1.0 | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/sh/tests/builtins/cd10.0 b/bin/sh/tests/builtins/cd10.0
index f4b5e0ffca5c..5c165cb21fcc 100644
--- a/bin/sh/tests/builtins/cd10.0
+++ b/bin/sh/tests/builtins/cd10.0
@@ -3,4 +3,4 @@
 # Precondition
 (cd /bin) || exit
 # Verify write error is ignored.
-$SH +m -ic 'CDPATH=/:; cd bin 1</dev/null'
+ENV= $SH +m -ic 'CDPATH=/:; cd bin 1</dev/null'
diff --git a/bin/sh/tests/builtins/fc1.0 b/bin/sh/tests/builtins/fc1.0
index ab7a387b5077..df4852f0b8ac 100644
--- a/bin/sh/tests/builtins/fc1.0
+++ b/bin/sh/tests/builtins/fc1.0
@@ -8,7 +8,7 @@ T=$(mktemp -d sh-test.XXXXXX)
 cd $T
 
 mkfifo input output error
-HISTFILE=/dev/null ${SH} +m -i <input >output 2>error &
+ENV= HISTFILE=/dev/null ${SH} +m -i <input >output 2>error &
 {
 	# Syntax error
 	echo ')' >&3
diff --git a/bin/sh/tests/execution/int-cmd1.0 b/bin/sh/tests/execution/int-cmd1.0
index a1f097b774d6..6b1d366b2e7a 100644
--- a/bin/sh/tests/execution/int-cmd1.0
+++ b/bin/sh/tests/execution/int-cmd1.0
@@ -1,3 +1,3 @@
 # $FreeBSD$
 
-! echo echo bad | $SH -ic 'fi' 2>/dev/null
+! echo echo bad | ENV= $SH -ic 'fi' 2>/dev/null