Commit cc0d46f6 by Eric Coissac

patch a bug in popvalue

parent 23ce8192
......@@ -83,6 +83,7 @@ function logwarning() {
function setloglevel () {
LOG_LEVEL=$(indirect "LOG_${1}_LEVEL")
loginfo "Logging level set to : ${1}"
}
function openlogfile() {
......
......@@ -55,14 +55,14 @@ function popvalue() {
local __popvalue_COMMAND="echo "
fi
local s=$(stacksize ${__popvalue_STACK})
if (( s==0 )); then
local __popvalue_s=$(stacksize ${__popvalue_STACK})
if (( __popvalue_s == 0 )); then
return 1
fi
local __popvalue_valcmd="${__popvalue_COMMAND}\${${__popvalue_STACK}[\$(( s - 1 ))]}"
local __popvalue_valcmd="${__popvalue_COMMAND}\${${__popvalue_STACK}[\$(( __popvalue_s - 1 ))]}"
eval $__popvalue_valcmd
valcmd="unset ${__popvalue_STACK}[\$(( s - 1 ))]"
__popvalue_valcmd="unset ${__popvalue_STACK}[\$(( __popvalue_s - 1 ))]"
eval $__popvalue_valcmd
return 0
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment