about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2008-11-10 17:12:50 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2008-11-10 17:12:50 +0000
commit1fa2d1e6e556e0f68f755aa64d0b232e34e5b8fd (patch)
tree5a310eeeb879da5b6900d11debd24cabc799eeff
parent5d13deda4e6c16a155c0ebab4c0372d36b8be751 (diff)
downloadzsh-1fa2d1e6e556e0f68f755aa64d0b232e34e5b8fd.tar.gz
zsh-1fa2d1e6e556e0f68f755aa64d0b232e34e5b8fd.tar.xz
zsh-1fa2d1e6e556e0f68f755aa64d0b232e34e5b8fd.zip
26022: fix on Solaris where /proc/$$/fd exists but doesn't contain symlinks
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Zsh/Type/_file_descriptors4
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 6debf1c86..f2d86cc90 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2008-11-08  Oliver Kiddle  <opk@zsh.org>
 
+	* 26022: Completion/Zsh/Type/_file_descriptors: fix on Solaris
+	where /proc/$$/fd exists but doesn't contain symlinks
+
 	* 26017: Completion/Unix/Type/_path_files, 
 	Completion/Zsh/Type/_globflags, Completion/Zsh/Type/_globquals:
 	add completion of globbing flags
diff --git a/Completion/Zsh/Type/_file_descriptors b/Completion/Zsh/Type/_file_descriptors
index 29d907940..1dac47f61 100644
--- a/Completion/Zsh/Type/_file_descriptors
+++ b/Completion/Zsh/Type/_file_descriptors
@@ -2,9 +2,9 @@
 
 local i fds expl list link sep
 
-for i in {0..9}; [[ -e /dev/fd/$i ]] && fds+=( $i )
+fds=( /dev/fd/<0-9>(N:t) )
 
-if zstyle -T ":completion:${curcontext}:" verbose && [[ -e /proc/$$/fd ]]; then
+if zstyle -T ":completion:${curcontext}:" verbose && [[ -h /proc/$$/fd/$fds[1] ]]; then
   zstyle -s ":completion:${curcontext}:" list-separator sep || sep=--
 
   if zmodload -F zsh/stat b:zstat; then