From 4412589e0c931aca94e2660c33b0325f5d630d0d Mon Sep 17 00:00:00 2001 From: Tim Harder Date: Wed, 8 Jul 2015 20:40:05 -0400 Subject: bash: remove __var_push comment about declare usage We could use declare statements but then we'd have to thread "-g" arguments into all of them to make them affect the global scope from within the __var_pop function. --- bash/isolated-functions.lib | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bash/isolated-functions.lib b/bash/isolated-functions.lib index 57c96d41..765dd0e1 100644 --- a/bash/isolated-functions.lib +++ b/bash/isolated-functions.lib @@ -216,10 +216,7 @@ __var_push() { # If the specified variable currently has a value we save it; # otherwise, just push the variable name onto the stack. if orig_val=$(declare -p ${var} 2>/dev/null); then - # We can't directly use the declare version because that forces - # scope to be localized to the function resetting the values. - # - # Posix mode needed so set only lists defined variables and not + # Posix mode needed so only defined variables are listed and not # functions too. __shopt_push -o posix orig_val=$(set | grep "^${var}=") -- cgit v1.2.3-65-gdbad