zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _init_d problem with read options
@ 2003-05-12  9:55 Oliver Kiddle
  2003-05-12 10:17 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Kiddle @ 2003-05-12  9:55 UTC (permalink / raw)
  To: Zsh workers

_init_d was broken due to `read -u0k 2' not working after the option
parsing changes.

Oliver

Index: Completion/Unix/Command/_init_d
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_init_d,v
retrieving revision 1.4
diff -u -r1.4 _init_d
--- Completion/Unix/Command/_init_d	21 May 2002 07:58:25 -0000	1.4
+++ Completion/Unix/Command/_init_d	12 May 2003 09:50:19 -0000
@@ -14,7 +14,7 @@
 
 what='(st(art|op|atus)|(force-|)re(start|load)|debug_(up|down)|dump(|_stats)|add|delete|clean|list)'
 
-read -u0k 2 magic < $script && [[ $magic = '#!' ]] &&
+read -u0 -k2 magic < $script && [[ $magic = '#!' ]] &&
     cmds=( ${${(j:|:s:|:)${(M)${(f)"$(< $script)"}:#[[:blank:]]#(\'|)${~what}(\|{~what})#(\'|)\)}}//[^a-z_]} )
 
 # This would be the pattern to use every line of the form <space>foo).


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: _init_d problem with read options
  2003-05-12  9:55 PATCH: _init_d problem with read options Oliver Kiddle
@ 2003-05-12 10:17 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2003-05-12 10:17 UTC (permalink / raw)
  To: Zsh workers

Oliver Kiddle wrote:
> _init_d was broken due to `read -u0k 2' not working after the option
> parsing changes.

This could probably be fixed up.  We have special handling for optional
numeric arguments to options, but not for mandatory because it didn't
seem necessary.  Adding that and making both look for the end of the
number would restore compatilibity.

However, I'm not completely sure that's the right way to go, since the
usual convention is that the argument extends to the end of the word;
with the change, we lose sanity checking (although we can still check
there is at least one digit present).

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-12 10:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-12  9:55 PATCH: _init_d problem with read options Oliver Kiddle
2003-05-12 10:17 ` Peter Stephenson

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).