From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id SAA18506 for ; Mon, 8 Jul 1996 18:23:24 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id EAA03483; Mon, 8 Jul 1996 04:16:24 -0400 (EDT) Resent-Date: Mon, 8 Jul 1996 04:16:24 -0400 (EDT) From: Zefram Message-Id: <28790.199607080757@stone.dcs.warwick.ac.uk> Subject: Re: Remaining zsh3.0-pre2 bugs To: schaefer@nbn.com Date: Mon, 8 Jul 1996 08:57:49 +0100 (BST) Cc: hzoli@cs.elte.hu, zsh-workers@math.gatech.edu In-Reply-To: <960707232105.ZM7626@candle.brasslantern.com> from "Bart Schaefer" at Jul 7, 96 11:21:03 pm X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]7776.65 X-US-Congress: Moronic fuckers MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"F1-4J.0.Ls.NFCun"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1566 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu >So I rather suspect that has something to do with the bug, but I'm lost >at this point in terms of knowing what \230 represents, or how it got >into tokstr and thus ultimately into clwords[1], or whether INULL() is >supposed to be true at that point. '\230' is Snull -- the token that the ' turns into. INULL() *is* supposed to be true for this token -- it indicates that that character should be ignored when considering the line at later stages of execution. The four tokens it is true for are Snull (single quote as here), Dnull (double quote), Bnull (backslash) and Nularg (an empty argument). Note that the ; in the middle did *not* turn into a token -- the lexer sees that it is quoted, so leaves it literal. If the line were actually being executed (pretending that it really is a ; and not a newline), the code after the lexer would see an argument a;b, ignoring the Snull tokens. Had the quotes not been there, the ; would have turned into a token and been treated specially. It's really quite an elegant system. Unfortunately it does fall over somewhat when the token values are appearing in the input as normal characters, but as you know we now have a workaround for that too. >Anyway, cs decrements down to 8 because of the two \230 in qword; but >"echo 'a;b'" of course has 10 characters. Bingo. That loop has special code for handling backslashes, but not quotes. I think it needs to handle quotes too. The completion code really doesn't cope with quotes at all, so I'm not surprised this is happening. -zefram