about summary refs log tree commit diff
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
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)
-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