Local IFS reset to our expected standard value

Revert 289782f350 (broken patch from issue #133) and really fix #132.
This commit is contained in:
Olivier Mengué 2013-05-14 00:34:48 +02:00
parent a963743bbb
commit cf8b8b29bb

View File

@ -1168,7 +1168,6 @@ _lp_load_color()
[[ "$LP_ENABLE_LOAD" != 1 ]] && return [[ "$LP_ENABLE_LOAD" != 1 ]] && return
local load local load
local IFS=" \t\n"
load="$(_lp_cpu_load | sed 's/\.//g;s/^0*//g' )" load="$(_lp_cpu_load | sed 's/\.//g;s/^0*//g' )"
let "load=${load:-0}/$_lp_CPUNUM" let "load=${load:-0}/$_lp_CPUNUM"
@ -1382,6 +1381,11 @@ _lp_time()
_lp_set_prompt() _lp_set_prompt()
{ {
# Reset IFS to its default value to avoid strange behaviors
# (in case the user is playing with the value at the prompt)
local IFS="$(echo -e ' \t')
" # space, tab, LF
# as this get the last returned code, it should be called first # as this get the last returned code, it should be called first
LP_ERR="$(_lp_sl $(_lp_return_value $?))" LP_ERR="$(_lp_sl $(_lp_return_value $?))"