Merge branch 'fix/IFS' of http://github.com/dolmen/liquidprompt into develop

This commit is contained in:
nojhan 2013-05-14 15:35:32 +02:00
commit 1e9036eb57

View File

@ -1169,7 +1169,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"
@ -1386,6 +1385,11 @@ _lp_set_prompt()
# 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 $?))"
# 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
# execute the old prompt if not on Mac OS X (Mountain) Lion # execute the old prompt if not on Mac OS X (Mountain) Lion
case "$LP_OS" in case "$LP_OS" in
Linux|FreeBSD|SunOS) $LP_OLD_PROMPT_COMMAND ;; Linux|FreeBSD|SunOS) $LP_OLD_PROMPT_COMMAND ;;