about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rwxr-xr-xCompletion/Unix/Command/_modutils9
2 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index ddbe6c859..fbe31f8b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-05-15  Oliver Kiddle  <opk@zsh.org>
+
+	* 14355: Completion/Unix/Command/_modutils: fix bug where /sbin/lsmod
+	was redirected in instead of being run
+
 2001-05-15  Sven Wischnowsky  <wischnow@zsh.org>
 
 	* 14350: Completion/Base/Completer/_expand, Src/Zle/zle_tricky.c:
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