diff --git a/neofetch b/neofetch index 6b5162a4..0cc63954 100755 --- a/neofetch +++ b/neofetch @@ -1968,14 +1968,13 @@ getascii() { 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 - lines=1 - while IFS='\n' read -r line 2>/dev/null; do - [ ${#line} -gt "$ascii_length" ] && ascii_length=${#line} - lines=$((lines+=1)) + while IFS='' read -r line 2>/dev/null; do + [ "${#line}" -gt "$ascii_length" ] && ascii_length="${#line}" done <<< "$ascii_strip" + lines="$(printf "%s\n" "$ascii_strip" | wc -l)" padding="\033[$((ascii_length + gap))C" printf "%b%s" "$print" export LC_ALL=C