From f5c8907ec58c21dcf59b01c45716ca780697861f Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Tue, 2 Jul 2002 14:06:44 +0000 Subject: keep globbing quiet in _path_files; check if group/user exists in _chown (17393) --- Completion/Unix/Command/_chown | 7 +++++-- Completion/Unix/Type/_path_files | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'Completion') diff --git a/Completion/Unix/Command/_chown b/Completion/Unix/Command/_chown index 599e09d14..e194677d2 100644 --- a/Completion/Unix/Command/_chown +++ b/Completion/Unix/Command/_chown @@ -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 @@ else 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 diff --git a/Completion/Unix/Type/_path_files b/Completion/Unix/Type/_path_files index dd1089e67..75933e623 100644 --- a/Completion/Unix/Type/_path_files +++ b/Completion/Unix/Type/_path_files @@ -338,7 +338,7 @@ for prepath in "$prepaths[@]"; do 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. -- cgit 1.4.1