Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: _init_d: avoid error when init.d service doesn't exist



This same check is done already in the case for freebsd.
Noticed by Daniel Hahler (blueyed) on irc.

---
 Completion/Unix/Command/_init_d |    1 +
 1 file changed, 1 insertion(+)

diff --git a/Completion/Unix/Command/_init_d b/Completion/Unix/Command/_init_d
index dd9933a..bbf62fc 100644
--- a/Completion/Unix/Command/_init_d
+++ b/Completion/Unix/Command/_init_d
@@ -68,6 +68,7 @@ else
 
     what='(st(art|op|atus)|(force-|)re(start|load)|debug_(up|down)|dump(|_stats)|add|delete|clean|list)'
 
+    [[ -x $script ]] || return 1
     read -u0 -k2 magic < $script && [[ $magic = '#!' ]] &&
     cmds=( ${${(j:|:s:|:)${(M)${(f)"$(< $script)"}:#[[:blank:]]#(\'|)${~what}([[:blank:]]#\|[[:blank:]]#${~what})#(\'|)\)}}//[^-a-z_]} )
 
-- 
1.7.10.GIT



Messages sorted by: Reverse Date, Date, Thread, Author