From 2dca19c985c4c238ef6e6548746f426e0949a3eb Mon Sep 17 00:00:00 2001 From: Ryan Caloras Date: Sat, 3 Aug 2019 14:41:57 -0400 Subject: [PATCH] Declare var as 'local' fix for #95 --- bash-preexec.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bash-preexec.sh b/bash-preexec.sh index 88a63aa..38d70bb 100644 --- a/bash-preexec.sh +++ b/bash-preexec.sh @@ -53,6 +53,7 @@ __bp_inside_preexec=0 # Fails if any of the given variables are readonly # Reference https://stackoverflow.com/a/4441178 __bp_require_not_readonly() { + local var for var; do if ! ( unset "$var" 2> /dev/null ); then echo "bash-preexec requires write access to ${var}" >&2