From b7d9ff9d3bf71b0f087071895df047946132c784 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 14 Aug 2006 19:30:31 +0000 Subject: 22601: need some unquoting in _list_files --- Completion/Unix/Type/_list_files | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Completion/Unix/Type/_list_files') diff --git a/Completion/Unix/Type/_list_files b/Completion/Unix/Type/_list_files index bd5c1fa62..5e745d9d1 100644 --- a/Completion/Unix/Type/_list_files +++ b/Completion/Unix/Type/_list_files @@ -8,7 +8,7 @@ # Sets array listfiles to the display strings and the array # listopts appropriately to be added to the compadd command line. -local stat f elt what +local stat f elt what dir local -a stylevals integer ok @@ -48,14 +48,17 @@ done zmodload -i zsh/stat 2>/dev/null || return 1 -for f in ${(P)1}; do - if [[ ! -e "${2:+$2/}$f" ]]; then - listfiles+=("${2:+$2/}$f") +dir=${2:+$2/} +dir=${(Q)dir} + +for f in ${(PQ)1}; do + if [[ ! -e "$dir$f" ]]; then + listfiles+=("$dir$f") continue fi # Borrowed from Functions/Example/zls - stat -s -H stat -F "%b %e %H:%M" - "${2:+$2/}$f" >/dev/null 2>&1 + stat -s -H stat -F "%b %e %H:%M" - "$dir$f" >/dev/null 2>&1 listfiles+=("$stat[mode] ${(l:3:)stat[nlink]} ${(r:8:)stat[uid]} \ ${(r:8:)stat[gid]} ${(l:8:)stat[size]} $stat[mtime] $f") -- cgit 1.4.1