zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@sunsite.dk>
Subject: PATCH: file descriptor completion
Date: Mon, 10 Nov 2008 18:09:11 +0100	[thread overview]
Message-ID: <24491.1226336951@thecus> (raw)

_file_descriptors wasn't working properly on Solaris where /proc/$$/fd
exists but it's contents are not symbolic links. This fixes it.

Oliver

Index: Completion/Zsh/Type/_file_descriptors
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_file_descriptors,v
retrieving revision 1.6
diff -u -r1.6 _file_descriptors
--- Completion/Zsh/Type/_file_descriptors	3 Jun 2008 09:30:58 -0000	1.6
+++ Completion/Zsh/Type/_file_descriptors	10 Nov 2008 17:03:08 -0000
@@ -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


                 reply	other threads:[~2008-11-10 17:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24491.1226336951@thecus \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).