about summary refs log tree commit diff
path: root/Completion/User/_su
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2000-05-19 16:19:39 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2000-05-19 16:19:39 +0000
commite20600c8a404d35bd4b4c02976ce08f5b166f415 (patch)
tree00770843d9013ec7a80c010f60a06e081adae4ce /Completion/User/_su
parentaea69f6e640a47f2f442bf58504c94dc8091e2ab (diff)
downloadzsh-e20600c8a404d35bd4b4c02976ce08f5b166f415.tar.gz
zsh-e20600c8a404d35bd4b4c02976ce08f5b166f415.tar.xz
zsh-e20600c8a404d35bd4b4c02976ce08f5b166f415.zip
Fix _su to use user's shell for completion after -c again
Diffstat (limited to 'Completion/User/_su')
-rw-r--r--Completion/User/_su6
1 files changed, 3 insertions, 3 deletions
diff --git a/Completion/User/_su b/Completion/User/_su
index e5bf09d80..daf301555 100644
--- a/Completion/User/_su
+++ b/Completion/User/_su
@@ -6,7 +6,7 @@ local shell comp name usr base
 (( base=$?+2 ))
 
 if [[ CURRENT -eq base ]]; then
-  compgen -u && return
+  _users && return
   usr=root
 elif [[ CURRENT -ge base+1 ]]; then
   usr=$words[base]
@@ -14,9 +14,9 @@ else
   return
 fi
 
-shell=${"$(egrep "^$usr:" </etc/passwd)"##*:}
+shell="${${(M@)${(@f)$(</etc/passwd)}:#$usr*}##*:}"
 compset -n $base
 for name in $shell $shell:t -default-; do
   comp="$_comps[$name]"
-  [[ ! -z "$comp" ]] && "$comp" && return
+  [[ -n "$comp" ]] && "$comp" && return
 done