simplify max columns number management

This commit is contained in:
Thomas DEBESSE 2012-08-07 20:59:58 +02:00 committed by nojhan
parent 2c73402a31
commit f7e3ad940c

View File

@ -318,13 +318,7 @@ __shorten_path()
local p=$(echo "$1" | sed -e "s|$HOME|~|")
local len="${#p}"
if [ -z "$COLUMNS" ]
then
local columns=80
else
local columns=$COLUMNS
fi
local max_len=$(($columns*$len_percent/100))
local max_len=$((${COLUMNS:-80}*$len_percent/100))
local mask_len="${#mask}"
if [[ "$len" -gt "$max_len" ]]