Fix padding on Android

This commit is contained in:
Dylan Araps 2016-08-28 10:49:35 +10:00
parent 12ba2f925a
commit 5444ecdf6d
1 changed files with 4 additions and 5 deletions

View File

@ -1968,14 +1968,13 @@ getascii() {
ascii_strip="${ascii_strip//'\\'/ }" ascii_strip="${ascii_strip//'\\'/ }"
ascii_strip="${ascii_strip//'\'}" ascii_strip="${ascii_strip//'\'}"
# Get lines/columns of the ascii file in pure bash. # Get length of the ascii file.
ascii_length=0 ascii_length=0
lines=1 while IFS='' read -r line 2>/dev/null; do
while IFS='\n' read -r line 2>/dev/null; do [ "${#line}" -gt "$ascii_length" ] && ascii_length="${#line}"
[ ${#line} -gt "$ascii_length" ] && ascii_length=${#line}
lines=$((lines+=1))
done <<< "$ascii_strip" done <<< "$ascii_strip"
lines="$(printf "%s\n" "$ascii_strip" | wc -l)"
padding="\033[$((ascii_length + gap))C" padding="\033[$((ascii_length + gap))C"
printf "%b%s" "$print" printf "%b%s" "$print"
export LC_ALL=C export LC_ALL=C