Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug: Wrong completion of $(( $(!cmd



On Jan 23,  1:04pm, Peter Stephenson wrote:
}
} 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.

I don't think that's true.  If you look at the tail end of dquote_parse()
you'll see that if lexstop is false the return value of dquote_parse() is
overloaded -- it's both an error indication AND the most recently read
character from the input stream.  That's what hungetc() is trying to put
back in that spot in cmd_or_math().

That doesn't make it correct, but that's what's going on.  There must be
(or have been at some past time) some other reason higher up the parse
tree why that final character needed to be retained.



Messages sorted by: Reverse Date, Date, Thread, Author