_lp_shorten_path: set value for locals on separate line (zsh)

zsh doesn't like if we set the value of a local while we declare it.
This commit is contained in:
Olivier Mengué 2013-12-17 00:06:32 +01:00
parent 81c93c1d52
commit 964f77834e

View File

@ -519,9 +519,11 @@ _lp_shorten_path()
return
fi
local p="${PWD/#$HOME/~}"
local -i len=${#p}
local -i max_len=$((${COLUMNS:-80}*$LP_PATH_LENGTH/100))
local p
p="${PWD/#$HOME/~}"
local -i len max_len
len=${#p}
(( max_len = ${COLUMNS:-80} * $LP_PATH_LENGTH / 100 ))
if $_LP_SHELL_bash; then
if (( len > max_len ))