From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7372 invoked from network); 2 Jul 2002 14:05:55 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 2 Jul 2002 14:05:55 -0000 Received: (qmail 26789 invoked by alias); 2 Jul 2002 14:05:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17393 Received: (qmail 26776 invoked from network); 2 Jul 2002 14:05:38 -0000 From: Sven Wischnowsky MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15649.45923.550204.970301@wischnow.berkom.de> Date: Tue, 2 Jul 2002 16:06:27 +0200 To: zsh-workers@sunsite.dk Subject: Re: [BUGREPORT] zsh-4.0.4 (i686-pc-linux-gnu) In-Reply-To: <7203.1025261563@csr.com> References: <20020626213832.GA391@morheus> <7203.1025261563@csr.com> X-Mailer: VM 7.03 under 21.5 (patch 5) "beets" XEmacs Lucid 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