From 8afbb0096204f61561b99726992969858b9d0f30 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Wed, 25 Apr 2012 09:12:58 +0000 Subject: 30429: avoid error in _init_d when service doesn't exist --- ChangeLog | 7 ++++++- Completion/Unix/Command/_init_d | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c23237baa..68f9922a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-04-25 Mikael Magnusson + + * 30429: Completion/Unix/Command/_init_d: Avoid error when the + service doesn't exist. + 2012-04-22 Peter Stephenson * unposted: Src/subst.c: add test for valid identifier to 30431. @@ -16237,5 +16242,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5639 $ +* $Revision: 1.5640 $ ***************************************************** diff --git a/Completion/Unix/Command/_init_d b/Completion/Unix/Command/_init_d index dd9933a46..bbf62fc0d 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_]} ) -- cgit 1.4.1