summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2001-05-15 15:14:20 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2001-05-15 15:14:20 +0000
commitb08c6d6e3954a313fa2573a5e9cafcf9b0a97d37 (patch)
treede94dde0ca38c500ee422fcad60f7541407da995 /Completion/Unix/Command
parentdc9d78c65971e9c6c7faf4488f4da6efb73bded1 (diff)
downloadzsh-b08c6d6e3954a313fa2573a5e9cafcf9b0a97d37.tar.gz
zsh-b08c6d6e3954a313fa2573a5e9cafcf9b0a97d37.tar.xz
zsh-b08c6d6e3954a313fa2573a5e9cafcf9b0a97d37.zip
fix bug where /sbin/lsmod was redirected in instead of being run (14355)
Diffstat (limited to 'Completion/Unix/Command')
-rwxr-xr-xCompletion/Unix/Command/_modutils9
1 files changed, 4 insertions, 5 deletions
diff --git a/Completion/Unix/Command/_modutils b/Completion/Unix/Command/_modutils
index 42481834b..1a725e511 100755
--- a/Completion/Unix/Command/_modutils
+++ b/Completion/Unix/Command/_modutils
@@ -1,19 +1,18 @@
 #compdef modprobe rmmod
 
-local loaded
+local expl loaded
 
 _modutils_loaded_modules() {
 
-if [[ -f /proc/modules ]]; then
+if [[ -r /proc/modules ]]; then
  loaded=(${${(f)"$(</proc/modules)"}%% *})
 elif [[ -x /sbin/lsmod ]]; then
- loaded=(${${${(f)"$(</sbin/lsmod)"}%% *}%Module})
+ loaded=(${${(f)"$(/sbin/lsmod)"}[2,-1]%% *})
 else
  return 1
 fi
 
-compadd -a loaded
-return 0
+_wanted modules expl 'loaded module' compadd -a loaded
 }
 
 case "$service" in