[openssh-commits] [openssh] 01/01: Save $? before case statement.

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Mar 22 17:01:51 AEDT 2018


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit c6cb2565c9285eb54fa9dfbb3890f5464aff410f
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Thu Mar 22 17:00:28 2018 +1100

    Save $? before case statement.
    
    In some shells (FreeBSD 9, ash) the case statement resets $?, so save
    for later testing.
---
 regress/key-options.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/regress/key-options.sh b/regress/key-options.sh
index e03cae58..d680737c 100644
--- a/regress/key-options.sh
+++ b/regress/key-options.sh
@@ -101,9 +101,10 @@ check_valid_before() {
 	sed "s/.*/$opts &/" $origkeys >$authkeys
 	verbose "key option expiry-time $which"
 	${SSH} -q -F $OBJ/ssh_proxy somehost true
+	r=$?
 	case "$expect" in
-	fail)	test $? -eq 0 && fail "key option succeeded $which" ;;
-	pass)	test $? -ne 0 && fail "key option failed $which" ;;
+	fail)	test $r -eq 0 && fail "key option succeeded $which" ;;
+	pass)	test $r -ne 0 && fail "key option failed $which" ;;
 	*)	fatal "unknown expectation $expect" ;;
 	esac
 }

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list