about summary refs log tree commit diff
path: root/Completion/compaudit
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-03-22 19:59:23 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-03-22 19:59:23 +0000
commitbd100f28381c496a86cb4fa74acad78aa763af47 (patch)
treedc470c8e35d3b5ce586888aeba8bedc83318f7b7 /Completion/compaudit
parentc5add3e2f5d7f7823206823959ce5f964cc796eb (diff)
downloadzsh-bd100f28381c496a86cb4fa74acad78aa763af47.tar.gz
zsh-bd100f28381c496a86cb4fa74acad78aa763af47.tar.xz
zsh-bd100f28381c496a86cb4fa74acad78aa763af47.zip
19669, 19670: Danek Duvall: two compaudit problems
Diffstat (limited to 'Completion/compaudit')
-rw-r--r--Completion/compaudit14
1 files changed, 6 insertions, 8 deletions
diff --git a/Completion/compaudit b/Completion/compaudit
index 528334dc0..c4dbb6e11 100644
--- a/Completion/compaudit
+++ b/Completion/compaudit
@@ -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