ascii: Strip esc chars when calculating length. Closes #942

This commit is contained in:
Dylan Araps 2018-04-06 15:11:53 +10:00
parent f25b76a0a5
commit 4083770a6b

View file

@ -2653,6 +2653,9 @@ get_ascii() {
print+="$line \n" print+="$line \n"
# Calculate size of ascii file in line length / line count. # Calculate size of ascii file in line length / line count.
line="${line//[??;?;??m}"
line="${line//[??;?;???m}"
line="${line//}"
line="${line//\$\{??\}}" line="${line//\$\{??\}}"
line="${line//\\\\/\\}" line="${line//\\\\/\\}"
((${#line} > ascii_length)) && ascii_length="${#line}" ((${#line} > ascii_length)) && ascii_length="${#line}"