]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
bootstrap: Disallow use of undefined shell variables, if possible.
authorR. Diez <rdiez-2006@rd10.de>
Mon, 2 Dec 2024 16:01:25 +0000 (11:01 -0500)
committerZack Weinberg <zack@owlfolio.org>
Mon, 2 Dec 2024 16:02:19 +0000 (11:02 -0500)
bootstrap

index 700ec25d12f2941dde657cfe5c3e654b6c15c263..3b7c1db41c599a419b62c4822b71a4b618178926 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -28,6 +28,9 @@
 set -e
 (set -o pipefail 2> /dev/null) && set -o pipefail
 
+# Error on undefined variables.
+(set -u 2> /dev/null) && set -u
+
 # Avoid problems due to various shell wrinkles.
 # We assume we have a shell new enough to implement unset correctly.
 (set -o posix 2> /dev/null) && set -o posix
@@ -109,7 +112,7 @@ fi
 # Override SHELL.  This is required on DJGPP so that Perl's system()
 # uses bash, not COMMAND.COM which doesn't quote arguments properly.
 # It's not used otherwise.
-if test -n "$DJDIR"; then
+if test -n "${DJDIR-}"; then
   BOOTSTRAP_SHELL=/dev/env/DJDIR/bin/bash.exe
 else
   BOOTSTRAP_SHELL=/bin/sh