From df39b04cb29f84d9ada3154230f364e69cacf850 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Tue, 27 Dec 2022 16:53:25 +0100 Subject: [PATCH] zsh:ls-show-hidden: Take quotes in double brackets --- .config/zsh/autoload/ls-show-hidden | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/zsh/autoload/ls-show-hidden b/.config/zsh/autoload/ls-show-hidden index e56c1ee..f5a871a 100755 --- a/.config/zsh/autoload/ls-show-hidden +++ b/.config/zsh/autoload/ls-show-hidden @@ -35,9 +35,9 @@ for arg in "$@"; do no_flags_from_here=1 elif [[ ${arg#-} != $arg ]] && (( ! no_flags_from_here )); then set -- "$@" "$arg" - elif [[ -d "$arg" ]]; then + elif [[ -d $arg ]]; then dirs+="$arg" - elif [[ -e "$arg" || -L "$arg" ]]; then + elif [[ -e $arg || -L $arg ]]; then files+="$arg" else printf >&2 "%s%s: cannot access '%s': No such file or directory%s\n" \ @@ -63,7 +63,7 @@ all_opts=("$@") empty=("") set -- "${(@)${(@)all_opts//--*}:|empty}" while getopts d flag 2>/dev/null; do - [[ "$flag" = "d" ]] || continue + [[ $flag = "d" ]] || continue command $LS_COMMAND "$all_opts[@]" -- "$files[@]" "$dirs[@]" return done @@ -87,7 +87,7 @@ for dir in ${(@f)dirs}; do content=( "$dir"/* ) # If the directory contains no visible files or it matches a pattern, then # show hidden files when listing - if (( ! $#content )) || [[ "${dir:A}" =~ "${LS_SHOW_ALL_DIRS:-^$}" ]]; then + if (( ! $#content )) || [[ ${dir:A} =~ ${LS_SHOW_ALL_DIRS:-^$} ]]; then all_flag="-A" else all_flag=