From c99b864590902ab61f61a6e4530b9b14208a475e Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 7 Jan 2019 18:34:20 +0200 Subject: [PATCH] ascii: Fixed bug when long line is input --- neofetch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index bf120339..3b56ea56 100755 --- a/neofetch +++ b/neofetch @@ -3429,11 +3429,11 @@ get_ascii() { # Calculate size of ascii file in line length / line count. while IFS=$'\n' read -r line; do - ((++lines,${#line}>ascii_length)) && ascii_length="${#line}" + ((++lines,${#line}>ascii_len)) && ascii_len="${#line}" done <<< "${ascii_data//\$\{??\}}" # Fallback if file not found. - ((lines==1)) && { image_source="auto"; get_distro_ascii; get_ascii; return; } + ((lines==1)) && { lines=; ascii_len=; image_source="auto"; get_distro_ascii; get_ascii; return; } # Colors. ascii_data="${ascii_data//\$\{c1\}/$c1}" @@ -3443,7 +3443,7 @@ get_ascii() { ascii_data="${ascii_data//\$\{c5\}/$c5}" ascii_data="${ascii_data//\$\{c6\}/$c6}" - ((text_padding=ascii_length+gap)) + ((text_padding=ascii_len+gap)) printf '%b\n' "$ascii_data${reset}" LC_ALL=C }