From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11114 invoked from network); 27 Jun 1998 12:18:52 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 27 Jun 1998 12:18:52 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id IAA04412; Sat, 27 Jun 1998 08:03:07 -0400 (EDT) Resent-Date: Sat, 27 Jun 1998 08:03:07 -0400 (EDT) Message-Id: <9806271159.AA15867@ibmth.df.unipi.it> To: zsh-workers@math.gatech.edu Subject: Re: PATCH: 3.1.4: flushing input properly In-Reply-To: ""Bart Schaefer""'s message of "Fri, 26 Jun 1998 09:54:21 DFT." <980626095421.ZM8207@candle.brasslantern.com> Date: Sat, 27 Jun 1998 13:59:51 +0200 From: Peter Stephenson Resent-Message-ID: <"d1ErJ.0.t41.xzDbr"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4179 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu "Bart Schaefer" wrote: > This looks good. Just one question ... why does discard_input() clear > and then set errflag, and why doesn't herrflush() need to do the same? I was careful to put herrflush() before calls to zerr() etc., and the history mechanism shouldn't be active with errflag already set. If the code as written doesn't work, I'd rather know where and why errflag was unexpectedly being set beforehand rather than blindly unsetting it. (Note it only affects adding the rest of the buffer onto the history line; the input mechanism will happily return characters already stored with errflag set, it just won't input a new line.) As for setting it after, you will see that every call to herrflush() is followed immediately by a call to an error function, whose task it properly is. As for why discard_input() did it... first of all, the existing code didn't always call the error function after rather than before, and secondly discard_input() was a bit out of place in parse.c rather than hist.c so its interaction with the history code was a bit murkier. I think it was just one those bits that never got tidied up properly till now. (The other complexities in discard_input() were what were dividing up the history line in a strange way, so I think they're well out of it.) -- Peter Stephenson Tel: +39 50 844536 WWW: http://www.ifh.de/~pws/ Gruppo Teorico, Dipartimento di Fisica Piazza Torricelli 2, 56100 Pisa, Italy