From 7b21d545b39d48b0d45ae3a3689f746ca258ccac Mon Sep 17 00:00:00 2001 From: Nathan Sketch Date: Thu, 7 Jan 2021 04:35:23 -0500 Subject: [PATCH] fixed bug with search function. added double quotes to stop $ans from parameter expanding and modified the logic for detecting an empty directory to stop it from overriding the logic for displaying 'no results'. --- shfm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shfm b/shfm index 86040fe..f38a66b 100755 --- a/shfm +++ b/shfm @@ -137,7 +137,7 @@ list_print() { mid=$((bottom / 4 < 5 ? 1 : bottom / 4)) case $# in - 1) [ -e "$1" ] || set -- empty + 1) [ -e "$1" ] || [ "$1" = 'no results' ] || set -- empty esac case $hist in @@ -359,7 +359,7 @@ main() { # word splitting and globbing intentional # shellcheck disable=2086 - set -- $ans* + set -- "$ans"* case $1$# in "$ans*1") set -- 'no results'