commit:     34d913e40a36173ba221c035e6e893bbdd0d9cee
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Mon May 12 12:11:51 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May 12 12:11:51 2025 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=34d913e4

Employ just one test for set -e and -u

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>

 functions.sh | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/functions.sh b/functions.sh
index e4f5a7c..72e3588 100644
--- a/functions.sh
+++ b/functions.sh
@@ -45,14 +45,9 @@ warn()
        printf '%s: %s\n' "${0##*/}" "$*" >&2
 }
 
-case $- in *e*)
+case $- in *[eu]*)
        # https://lists.gnu.org/archive/html/help-bash/2020-04/msg00049.html
-       warn "gentoo-functions does not support the errexit option; unexpected 
behaviour may ensue"
-esac
-
-case $- in *u*)
-       # https://lists.gnu.org/archive/html/help-bash/2020-04/msg00049.html
-       warn "gentoo-functions does not support the nounset option; unexpected 
behaviour may ensue"
+       warn "gentoo-functions supports neither the errexit option nor the 
nounset option; unexpected behaviour may ensue"
 esac
 
 case ${KSH_VERSION} in 'Version AJM 93'*)

Reply via email to