From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7066 invoked from network); 19 Oct 2000 07:11:04 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 19 Oct 2000 07:11:04 -0000 Received: (qmail 3287 invoked by alias); 19 Oct 2000 07:10:58 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13034 Received: (qmail 3280 invoked from network); 19 Oct 2000 07:10:57 -0000 Date: Thu, 19 Oct 2000 00:10:54 -0700 (PDT) From: Wayne Davison X-Sender: wayne@phong.blorf.net To: Bart Schaefer Cc: Zsh hackers list Subject: Re: parse errors and up-line-or-history In-Reply-To: <1001018153811.ZM4426@candle.brasslantern.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 18 Oct 2000, Bart Schaefer wrote: > Aha! It's HIST_REDUCE_BLANKS! Unset that option, and the entire command > line makes it into the history. Yes, histreduceblanks() expects all the content on the line to be represented in the chwords[] array so that it can tell which spaces are significant and which aren't. There are a few solutions I can think of. One would be to add the unparsed part of the line to chwords[]. Another would be to have histreduceblanks() notice the extra content beyond the last chwords[] item and preserve it. The easiest one, though, is to not try to reduce the blanks on a line that didn't parse right. I opted for this last solution for now: Index: Src/hist.c @@ -1063,11 +1063,12 @@ } #endif /* get rid of pesky \n which we've already nulled out */ - if (chwordpos > 1 && !chline[chwords[chwordpos-2]]) + if (chwordpos > 1 && !chline[chwords[chwordpos-2]]) { chwordpos -= 2; - /* strip superfluous blanks, if desired */ - if (isset(HISTREDUCEBLANKS)) - histreduceblanks(); + /* strip superfluous blanks, if desired */ + if (isset(HISTREDUCEBLANKS)) + histreduceblanks(); + } if ((isset(HISTIGNOREDUPS) || isset(HISTIGNOREALLDUPS)) && he && histstrcmp(chline, he->text) == 0) { /* This history entry compares the same as the previous. I've tested this, and it appears to work fine, so I think I'll go ahead and check it in. ..wayne..