1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-01 21:51:40 +02:00

arno: 23910: spaces in cases in init script

This commit is contained in:
Peter Stephenson 2007-10-08 08:40:12 +00:00
parent a66f502e53
commit f41d769adc
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2007-10-08 Peter Stephenson <pws@csr.com>
* arno: 23910: Completion/Unix/Command/_init_d: handle
spaces in cases in init scripts.
2007-10-08 Clint Adams <clint@zsh.org>
* 23911: configure.ac, Src/Modules/curses.c,

View file

@ -15,7 +15,7 @@ script=$words[1]
what='(st(art|op|atus)|(force-|)re(start|load)|debug_(up|down)|dump(|_stats)|add|delete|clean|list)'
read -u0 -k2 magic < $script && [[ $magic = '#!' ]] &&
cmds=( ${${(j:|:s:|:)${(M)${(f)"$(< $script)"}:#[[:blank:]]#(\'|)${~what}(\|${~what})#(\'|)\)}}//[^-a-z_]} )
cmds=( ${${(j:|:s:|:)${(M)${(f)"$(< $script)"}:#[[:blank:]]#(\'|)${~what}([[:blank:]]#\|[[:blank:]]#${~what})#(\'|)\)}}//[^-a-z_]} )
# This would be the pattern to use every line of the form <space>foo).
# Some people say this might match too many lines...