Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug: Wrong completion of $(( $(!cmd
- X-seq: zsh-workers 23126
- From: Peter Stephenson <pws@xxxxxxx>
- To: Zsh Hackers <zsh-workers@xxxxxxxxxx>
- Subject: Re: Bug: Wrong completion of $(( $(!cmd
- Date: Tue, 23 Jan 2007 13:10:32 +0000
- In-reply-to: <200701231304.l0ND4b3t011195@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Organization: Cambridge Silicon Radio
- References: <slrnepu2ml.2tv.joerg@xxxxxxxxxxxx> <20070122234306.GA24536@xxxxxxxxxxxxxxx> <200701231304.l0ND4b3t011195@xxxxxxxxxxxxxx>
Peter Stephenson <pws@xxxxxxx> wrote:
> Geoff Wing wrote:
> > On Saturday 2007-01-06 23:48 +1100, J_rg Sommer output:
> > :% echo 12
> > :12
> > :% echo $(( $(!echo<TAB>
> > :% echo $($(( $(echo 12
> >
> > and inungetc() just after gives me 11 lines of
> > Warning: backing up wrong character.
>
> The problem is somewhere here (in lex.c). If dquote_parse() returns
> non-zero it's an error indication, not a character, so the hungetc(c) is
> definitely wrong in that case. However, I don't understand the
> intention behind error handling at this point. I think we probably need
> to return 1 earlier.
Is it this simple? Seems to do the trick...
Index: Src/lex.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/lex.c,v
retrieving revision 1.37
diff -u -r1.37 lex.c
--- Src/lex.c 19 Jan 2007 21:36:03 -0000 1.37
+++ Src/lex.c 23 Jan 2007 13:08:47 -0000
@@ -542,14 +542,14 @@
c = dquote_parse(')', 0);
cmdpop();
*bptr = '\0';
- if (!c) {
- c = hgetc();
- if (c == ')')
- return 1;
- hungetc(c);
- lexstop = 0;
- c = ')';
- }
+ if (c)
+ return 1;
+ c = hgetc();
+ if (c == ')')
+ return 1;
+ hungetc(c);
+ lexstop = 0;
+ c = ')';
hungetc(c);
lexstop = 0;
while (len > oldlen) {
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview
Messages sorted by:
Reverse Date,
Date,
Thread,
Author