Skip to content

Commit

Permalink
ascii: Strip esc chars when calculating length. Closes #942
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanaraps committed Apr 6, 2018
1 parent f25b76a commit 4083770
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -2653,6 +2653,9 @@ get_ascii() {
print+="$line \n"

# Calculate size of ascii file in line length / line count.
line="${line//[??;?;??m}"
line="${line//[??;?;???m}"
line="${line//}"
line="${line//\$\{??\}}"
line="${line//\\\\/\\}"
((${#line} > ascii_length)) && ascii_length="${#line}"
Expand Down

0 comments on commit 4083770

Please sign in to comment.