1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-01 18:30:55 +01:00

37201: change quoting to handle group names with spaces

This commit is contained in:
Matthew Martin 2015-11-22 19:57:51 -08:00 committed by Barton E. Schaefer
parent 14487ff5cc
commit 6fe05eac84
2 changed files with 7 additions and 2 deletions

View file

@ -13,9 +13,9 @@ if ! zstyle -a ":completion:${curcontext}:" groups groups; then
: ${(A)_cache_groups:=${${(M)${(f)"$(_call_program groups dscacheutil -q group)"}:#name*}##*: }}
fi
elif (( ${+commands[getent]} )); then
: ${(A)_cache_groups:=${${(s: :)$(_call_program groups getent group 2>/dev/null)}%%:*}}
: ${(A)_cache_groups:=${${(f)"$(_call_program groups getent group 2>/dev/null)"}%%:*}}
else
: ${(A)_cache_groups:=${${${(s: :)$(</etc/group)}%%:*}:#+}}
: ${(A)_cache_groups:=${${${(f)"$(</etc/group)"}%%:*}:#+}}
if (( ${+commands[ypcat]} )) &&
tmp=$(_call_program groups ypcat group.byname 2>/dev/null); then
_cache_groups+=( ${${(f)tmp}%%:*} ) # If you use YP