1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-29 19:00:57 +02:00

19669, 19670: Danek Duvall: two compaudit problems

This commit is contained in:
Peter Stephenson 2004-03-22 19:59:23 +00:00
parent c5add3e2f5
commit bd100f2838
2 changed files with 15 additions and 8 deletions

View file

@ -1,3 +1,12 @@
2004-03-22 Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
* 19669, 19670: Danek Duvall: Completion/compaudit: Use of
getent to check groups was slow; typo caused duplicate fpath
entries.
* 19671: Src/Zle/zle_main.c: error in zle-line-init caused
infinite loop.
2004-03-20 Bart Schaefer <schaefer@zsh.org>
* 19666 (tweaked): Completion/Unix/Command/_ssh: fixes for remote

View file

@ -64,7 +64,7 @@ if [[ -n $_compdir ]]; then
# Likewise (installation-layout)
_i_addfiles=(${_compdir}/*(/))
fi
for _i_line in {1..$#i_addfiles}; do
for _i_line in {1..$#_i_addfiles}; do
_i_file=${_i_addfiles[$_i_line]}
[[ -d $_i_file && -z ${fpath[(r)$_i_file]} ]] ||
_i_addfiles[$_i_line]=
@ -83,13 +83,11 @@ fi
# that this has not happened, and pick the best group.
local GROUP GROUPMEM _i_pw _i_gid _i_ulwdirs
while IFS=: read GROUP _i_pw _i_gid GROUPMEM; do
if (( UID == EUID )); then
[[ $GROUP == $LOGNAME ]] && break
else
(( _i_gid == EGID )) && break # Somewhat arbitrary
fi
done <<(getent group)
if ((UID == EUID )); then
getent group $LOGNAME | IFS=: read GROUP _i_pw _i_gid GROUPMEM
else
getent group $EGID | IFS=: read GROUP _i_pw _i_gid GROUPMEM
fi
# We search for:
# - world/group-writable directories in fpath not owned by root and the user