From b399f49077a98790ab52b5c70efba5dc39120835 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 7 Jan 2019 18:17:56 +0200 Subject: [PATCH] ascii: Fixed bug when files named auto or ascii were found. --- neofetch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/neofetch b/neofetch index c6f092b9..bf120339 100755 --- a/neofetch +++ b/neofetch @@ -3417,12 +3417,12 @@ image_backend() { } get_ascii() { - if [[ -f "$image_source" && ! "$image_source" =~ (png|jpg|jpeg|jpe|svg|gif) ]]; then - ascii_data="$(< "$image_source")" - - elif [[ "$image_source" != "auto" ]]; then - ascii_data="$image_source" - fi + [[ ! "$image_source" =~ (ascii|auto) ]] && + if [[ -f "$image_source" && ! "$image_source" =~ (png|jpg|jpeg|jpe|svg|gif) ]]; then + ascii_data="$(< "$image_source")" + else + ascii_data="$image_source" + fi # Set locale to get correct padding. LC_ALL="$sys_locale"