about summary refs log tree commit diff
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
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
-rw-r--r--ChangeLog4
-rw-r--r--Completion/User/_su6
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d81143076..38a030659 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-05-19  Oliver Kiddle  <opk@zsh.org>
+
+	* 11470: Completion/User/_su: fix to use user's shell after -c
+
 2000-05-19  Bart Schaefer  <schaefer@zsh.org>
 
 	* 11469: Completion/Commands/_complete_debug,
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