zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@berkom.de>
To: zsh-workers@sunsite.dk
Subject: Re: [BUGREPORT] zsh-4.0.4 (i686-pc-linux-gnu)
Date: Tue, 2 Jul 2002 16:06:27 +0200	[thread overview]
Message-ID: <15649.45923.550204.970301@wischnow.berkom.de> (raw)
In-Reply-To: <7203.1025261563@csr.com>


Peter Stephenson wrote:

> monbil_f@epita.fr wrote:
> > morpheus# chgrp adm kern.log
> > _path_files:340: unknown group
> > morpheus# chgrp adm kern.log
> > 
> > when i tab after kern.log and a space in order to choose another file to
> > chgrp.
> 
> What's happening is that it's trying to complete files which aren't
> already owned by the group `adm'.  So the file completion code in
> _path_files uses a pattern for that purpose.  It then complains if the
> group `adm' doesn't exist.  However, it should only do that if the group
> adm *really* doesn't exist on your system.  Are you sure it does?  In
> which case the problem is somewhere inside zsh, to do with its interface
> with the system commands for reading groups.

I can't see much the completion code can do besides trying to keep
globbing quiet (in _path_files) and checking if the group exists (in
_chown). That stuff in _chown could be improved, obviously.


Bye
  Sven

Index: Completion/Unix/Command/_chown
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_chown,v
retrieving revision 1.6
diff -u -r1.6 _chown
--- Completion/Unix/Command/_chown	22 Jan 2002 10:22:48 -0000	1.6
+++ Completion/Unix/Command/_chown	2 Jul 2002 14:03:53 -0000
@@ -1,6 +1,6 @@
 #compdef chown chgrp
 
-local suf usr grp req expl line
+local suf usr grp req line
 
 line=( "${(@)words[2,CURRENT-1]:#-*}" )
 
@@ -33,6 +33,9 @@
   req=( ${usr:+\^u$usr} ${grp:+\^g$grp} )
   (( EUID )) && req=( u$EUID$^req )
   req=( -$^req )
+  req="*(${(j:,:)req})"
 
-  _wanted files expl file _files -g "*(${(j:,:)req})" && return 0
+  ( : $~req ) 2> /dev/null || req='*'
+
+  _files -g "$req" && return 0
 fi
Index: Completion/Unix/Type/_path_files
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_path_files,v
retrieving revision 1.18
diff -u -r1.18 _path_files
--- Completion/Unix/Type/_path_files	29 May 2002 15:05:24 -0000	1.18
+++ Completion/Unix/Type/_path_files	2 Jul 2002 14:03:53 -0000
@@ -338,7 +338,7 @@
     else
       compfiles -p$cfopt tmp1 accex "$skipped" "$_matcher $matcher[2]" '' fake "$pats[@]"
     fi
-    tmp1=( $~tmp1 )
+    tmp1=( $~tmp1 ) 2> /dev/null
 
     if [[ -n "$PREFIX$SUFFIX" ]]; then
       # See which of them match what's on the line.

-- 
Sven Wischnowsky                          wischnow@berkom.de


      reply	other threads:[~2002-07-02 14:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-26 21:38 monbil_f
2002-06-28 10:52 ` Peter Stephenson
2002-07-02 14:06   ` Sven Wischnowsky [this message]

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=15649.45923.550204.970301@wischnow.berkom.de \
    --to=wischnow@berkom.de \
    --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).