Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: _init_d: avoid error when init.d service doesn't exist
- X-seq: zsh-workers 30429
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: _init_d: avoid error when init.d service doesn't exist
- Date: Fri, 20 Apr 2012 17:45:48 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer; bh=wdj3vGzApIep4hSxWseAsH0c24Ujz37QgyoLAh9R9ts=; b=GwQ8Dy6CslZLHUfd3JiAiSXFo2654G86FIk7wCBqG7vzcpYi2h9SPy/RhgVukTY7QU qgDU7QvM6i5JvAHx80XN2GUv1Z6Ya0mw3VZe6BOvM3tERyxyFXKSjftQY6Nd2U9OUiI2 ROI95x0jMXivXDp69KfLnhInGD27REgAPg1CKQGVAwARtzQ+caaqFwGzTGcKkHUEb2+b vMEugryNdlL07p5KiZahoHYnlVtUGoVmTVTsyXINMZW26e6t4ebOwmvUs3M8ruut8StX u2DUtmet/SdlMekuW1RXJiq0T7FUWXBjwjWVPc2gMNknSpOw+wIrHCjme6mNxlBbJSW3 97tQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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