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 coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id HAA05159 for ; Tue, 13 Aug 1996 07:25:51 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id RAA02236; Mon, 12 Aug 1996 17:15:39 -0400 (EDT) Resent-Date: Mon, 12 Aug 1996 17:15:39 -0400 (EDT) Message-Id: <199608122113.OAA03985@bebop.clari.net> X-Mailer: exmh version 1.6.7 5/3/96 To: Zsh hackers list Subject: Re: hist_strip_spaces In-reply-to: wayne's message of Mon, 12 Aug 1996 12:17:53 -0700. <199608121917.MAA03396@bebop.clari.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 12 Aug 1996 14:13:49 -0700 From: Wayne Davison Resent-Message-ID: <"MRZpY3.0.tY.wxv3o"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1953 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu One problem with my patch is an optimization I added to check if the line really needs to be rewritten -- it didn't properly handle trailing spaces. The following patch fixes this. ..wayne.. ---8<------8<------8<------8<---cut here--->8------>8------>8------>8--- Index: Src/hist.c @@ -658,7 +658,7 @@ for (i = 0, len = he->nwords-1; i < limit; i += 2) len += he->words[i+1] - he->words[i]; - if (len == he->words[limit-1]) + if (he->text[len] == '\0') return; str = zalloc(len+1); ---8<------8<------8<------8<---cut here--->8------>8------>8------>8---