summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Type/_list_files13
2 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index cd86dfb88..269e32943 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,11 @@
* 22605: Src/Zle/complist.c: bug in 22597 noticed by Bart
when not printing.
+2006-08-13 Peter Stephenson <p.w.stephenson@ntlworld.com>
+
+ * 22601: Completion/Unix/Type/_list_files: need to unquote
+ characters quoted by the completion mechanism.
+
2006-08-13 Clint Adams <clint@zsh.org>
* unposted: Functions/Zle/.distfiles,
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")