From 679338624b8e597c2b8d568e421a0123d48dcc7f Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 26 Feb 2016 02:17:44 -0500 Subject: eshld/eshrt: Add "unset IFS" before for loops --- (limited to 'eshld') diff --git a/eshld/eshrt.esh b/eshld/eshrt.esh index ad03b09..43c4cc6 100644 --- a/eshld/eshrt.esh +++ b/eshld/eshrt.esh @@ -101,6 +101,7 @@ __fn_ctxsw() __fn_update_vars() { + unset IFS for __var in ${__fn_vars}; do __val="$(eval "printf '%s' \"\${${__var}}\"" | \ sed "s|'|'\\\\''|g;")" @@ -111,6 +112,7 @@ __fn_update_vars() __fn_start() { # Hooks. + unset IFS for __fn in ${__fn_begin_hooks}; do ${__fn} ${2} done @@ -140,6 +142,7 @@ __fn_start() __fn_end() { # Hooks. + unset IFS for __fn in ${__fn_end_hooks}; do ${__fn} ${__fn_name} done @@ -161,6 +164,7 @@ __fn_end() __tu_end() { # Save TU static vars. + unset IFS for __var in $(eval "printf '%s' \"\${__${__tu}_static_vars}\""); do __val="$(eval "printf '%s' \"\${${__var}}\"" | \ sed "s|'|'\\\\''|g")" @@ -183,6 +187,7 @@ __stack_trace() __local() { + unset IFS for __var in "${@}"; do case "${__var}" in *=*) @@ -209,6 +214,7 @@ static() printf 'Error: Cannot declare static variables in functions' >&2 exit 1 ;; esac + unset IFS for __var in "${@}"; do case "${__var}" in *=*) @@ -253,6 +259,7 @@ eshrtend() shift 1 cat <<-'EOF' +unset IFS for __func in ${__init_funcs}; do ${__func} done -- cgit v0.9.1