zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _init_d: avoid error when init.d service doesn't exist
@ 2012-04-20 15:45 Mikael Magnusson
  0 siblings, 0 replies; only message in thread
From: Mikael Magnusson @ 2012-04-20 15:45 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-04-20 15:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-20 15:45 PATCH: _init_d: avoid error when init.d service doesn't exist Mikael Magnusson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).