1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-06-11 01:36:03 +02:00

fix bug where /sbin/lsmod was redirected in instead of being run (14355)

This commit is contained in:
Oliver Kiddle 2001-05-15 15:14:20 +00:00
parent dc9d78c659
commit b08c6d6e39
2 changed files with 9 additions and 5 deletions

View File

@ -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:

View File

@ -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