From 892017875386d31970bd7329c19646469ccf2676 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 24 Sep 2020 15:18:34 +0300 Subject: [PATCH] shfm: fix glob issues with hidden files Let's just allow '.' and '..' to appear in the list as they are fully functional entries after all. Also removes the need for a "no hidden files" message. --- shfm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/shfm b/shfm index 5aa0086..86040fe 100755 --- a/shfm +++ b/shfm @@ -136,9 +136,8 @@ list_print() { end=$((bottom + 1)) mid=$((bottom / 4 < 5 ? 1 : bottom / 4)) - [ -e "$1" ] || case $1$# in - '*1') set -- empty ;; - '.[!.]*1') set -- 'no hidden files' + case $# in + 1) [ -e "$1" ] || set -- empty esac case $hist in @@ -331,8 +330,8 @@ main() { .?) case ${hidden:=1} in - 1) hidden=0; set -- .[!.]* ;; - *) hidden=1; set -- * ;; + 1) hidden=0; set -- .* ;; + 0) hidden=1; set -- * esac y=1 y2=1 cur=$1