From 1955cceec79107b6571646b695d334df8e4a6cd8 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 24 Nov 2016 07:02:11 +0000 Subject: 40011: Make $_comp_priv_prefix only declared when required, and use that to have chgrp offer all groups under doas, ssh, etc as well. --- Completion/Unix/Command/_chown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Completion/Unix/Command/_chown') diff --git a/Completion/Unix/Command/_chown b/Completion/Unix/Command/_chown index 641b5a773..5750c65ab 100644 --- a/Completion/Unix/Command/_chown +++ b/Completion/Unix/Command/_chown @@ -45,8 +45,8 @@ _arguments -C -s "$args[@]" '*:files:->files' && ret=0 case $state in owner) if [[ $service = chgrp ]] || compset -P '*[:.]'; then - if (( EGID && $+commands[groups] && ! $+funcstack[(r)_sudo] )); then # except for root - _wanted groups expl 'group' compadd $(groups) && return 0 + if (( EGID && $+commands[groups] && ! $+_comp_priv_prefix )); then # except for sudo + _wanted groups expl 'group' compadd -- $(groups) && return 0 fi _groups && ret=0 else -- cgit v1.2.3