diff options
Diffstat (limited to 'eshld')
-rw-r--r-- | eshld/eshrt.esh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/eshld/eshrt.esh b/eshld/eshrt.esh index 9efbbe0..7e03ef2 100644 --- a/eshld/eshrt.esh +++ b/eshld/eshrt.esh @@ -85,7 +85,11 @@ __fn_ctxsw() ${__fn_tu});; ?*) # Unset static variables and functions from previous TU. - eval "unset \${__${__prev_tu}_static_vars}" + case "$(eval "printf '%s' \ + \"\${__${__prev_tu}_static_vars}\"")" \ + in ?*) + eval "unset \${__${__prev_tu}_static_vars}" + ;; esac for __fn in $(eval printf '%s' \ "\"\${__${__prev_tu}_static_fns}\""); do unset -f "${__fn%:*}" @@ -102,7 +106,9 @@ __fn_ctxsw() eval "${__fn%:*}() { ${__fn#*:}; }" done ;; esac - unset ${__prev_vars} + case "${__prev_vars}" in ?*) + unset ${__prev_vars} + ;; esac eval "${__fn_var_vals}" } |