From 71afdbc878cff0f085da216cbbfa8c721090b629 Mon Sep 17 00:00:00 2001 From: "R. Diez" Date: Mon, 2 Dec 2024 11:01:25 -0500 Subject: [PATCH] bootstrap: Disallow use of undefined shell variables, if possible. --- bootstrap | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bootstrap b/bootstrap index 700ec25d1..3b7c1db41 100755 --- 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 -- 2.47.3