mirror of
https://github.com/dylanaraps/shfm.git
synced 2026-11-24 20:21:40 +00:00
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'.
This commit is contained in:
1 parent
8920178753
commit
7b21d545b3
1 file changed
+2
-2
@@ -137,7 +137,7 @@ list_print() {
|
|||||||
mid=$((bottom / 4 < 5 ? 1 : bottom / 4))
|
mid=$((bottom / 4 < 5 ? 1 : bottom / 4))
|
||||||
|
|
||||||
case $# in
|
case $# in
|
||||||
1) [ -e "$1" ] || set -- empty
|
1) [ -e "$1" ] || [ "$1" = 'no results' ] || set -- empty
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case $hist in
|
case $hist in
|
||||||
@@ -359,7 +359,7 @@ main() {
|
|||||||
|
|
||||||
# word splitting and globbing intentional
|
# word splitting and globbing intentional
|
||||||
# shellcheck disable=2086
|
# shellcheck disable=2086
|
||||||
set -- $ans*
|
set -- "$ans"*
|
||||||
|
|
||||||
case $1$# in
|
case $1$# in
|
||||||
"$ans*1") set -- 'no results'
|
"$ans*1") set -- 'no results'
|
||||||
|
|||||||
Reference in new issue
Block a user