From 4891607afdded0cafbf74b6b9c36b7899cd89704 Mon Sep 17 00:00:00 2001 From: Dmitrij Czarkoff Date: Sat, 5 Mar 2016 12:30:18 +0000 Subject: POSIX-compliant behavior of "set -u" regarding "$*" and "$@" specials All work done by Martijn Dekker OK millert@ --- regress/bin/ksh/obsd-regress.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'regress/bin/ksh') diff --git a/regress/bin/ksh/obsd-regress.t b/regress/bin/ksh/obsd-regress.t index e7988f5ca03..26759c89cbb 100644 --- a/regress/bin/ksh/obsd-regress.t +++ b/regress/bin/ksh/obsd-regress.t @@ -1,4 +1,4 @@ -# $OpenBSD: obsd-regress.t,v 1.1 2013/12/02 20:39:44 millert Exp $ +# $OpenBSD: obsd-regress.t,v 1.2 2016/03/05 12:30:17 czarkoff Exp $ # # ksh regression tests from OpenBSD @@ -273,3 +273,14 @@ stdin: set foo bar baz ; for out in ; do echo $out ; done --- + +name: shellopt-u-1 +description: + Check that "$@" and "$*" are exempt from 'set -u' (nounset) +stdin: + set -u + : "$@$*$1" +expected-exit: e == 1 +expected-stderr-pattern: + /: 1: parameter not set$/ +--- -- cgit v1.2.3