summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2016-02-26 02:17:44 (EST)
committer P. J. McDermott <pj@pehjota.net>2016-02-26 02:17:44 (EST)
commit679338624b8e597c2b8d568e421a0123d48dcc7f (patch)
treefe40c9fc137455fe4dbe2c631975f35c651cb553
parentc9b9e578ed90b5421ae77f7e55941be09f17bdab (diff)
downloadeggshell-679338624b8e597c2b8d568e421a0123d48dcc7f.zip
eggshell-679338624b8e597c2b8d568e421a0123d48dcc7f.tar.gz
eggshell-679338624b8e597c2b8d568e421a0123d48dcc7f.tar.bz2
eshld/eshrt: Add "unset IFS" before for loops
-rw-r--r--eshld/eshrt.esh7
1 files changed, 7 insertions, 0 deletions
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