slitaz-base-files rev 327

libtaz.sh: get_cols is not working: find an other way :-)
author Christophe Lincoln <pankso@slitaz.org>
date Tue Feb 28 15:08:28 2017 +0100 (2017-02-28)
parents dc1168e2359b
children 133ee7fe8217
files rootfs/lib/libtaz.sh
line diff
     1.1 --- a/rootfs/lib/libtaz.sh	Sat Feb 18 10:11:56 2017 +0000
     1.2 +++ b/rootfs/lib/libtaz.sh	Tue Feb 28 15:08:28 2017 +0100
     1.3 @@ -39,16 +39,18 @@
     1.4  done
     1.5  [ "$HTTP_REFERER" ] && output='html'
     1.6  
     1.7 -
     1.8 -
     1.9 -
    1.10  # i18n functions
    1.11  _()  { local T="$1"; shift; printf "$(gettext "$T")" "$@"; echo; }
    1.12  _n() { local T="$1"; shift; printf "$(gettext "$T")" "$@"; }
    1.13  _p() { local S="$1" P="$2" N="$3"; shift 3; printf "$(ngettext "$S" "$P" "$N")" "$@"; }
    1.14  
    1.15  # Get terminal columns
    1.16 -get_cols() { stty size 2>/dev/null | awk -vc=$cols 'END{print c?c:($2 && $2<80)?$2:80}'; }
    1.17 +get_cols() { 
    1.18 +	#stty size 2>/dev/null | awk -vc=$cols 'END{print c?c:($2 && $2<80)?$2:80}';
    1.19 +	if ! stty size | cut -d " " -f 2; then
    1.20 +		echo 80
    1.21 +	fi
    1.22 +}
    1.23  
    1.24  # Last command status
    1.25  status() {