From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23993 invoked by alias); 17 Jul 2014 12:58:48 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32879 Received: (qmail 24072 invoked from network); 17 Jul 2014 12:58:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=durin42.com; h=date:from :to:subject:message-id:mime-version:content-type; s=durin42.com; bh=A1w0kIsrZ+l9n5e2GA9UD/FQjjw=; b=bBSrs0D+qwz/1NTiBVrhckJdX1Pd kpGks7A/h8aQ+GN4+kc5yvNBQpjyWohI84V1pml1lMcFvqbfceOl5KWm992usrXS vv2dssxEkz5s5eGgKQgFhJN14I94dnBtbBtJ6t7GokPrFX0Z8yNdHorai/fhif0S ukPU4XtTWBSp7VM= Date: Thu, 17 Jul 2014 08:58:41 -0400 From: Augie Fackler To: zsh-workers@zsh.org Subject: [PATCH] Fix loading of multi-line history entires from disk Message-ID: <20140717125841.GA27001@arthedain.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21+134 (87ba4fb93754) (2012-12-30) Fixes the issue I posted about yesterday with history-incremental-search-backward. I have no idea as to the correctness of the fix, but my history file is written out in a way that matches 4.3.x with this patch applied, and the behavior matches again. (Not subscribed to zsh-workers, so if you want me to see replies promptly please keep me on the CC line. Thanks!) commit 4b2e7d1047419648291701d80268629f63ad6208 Author: Augie Fackler Date: Wed Jul 16 09:35:22 2014 -0400 hist.c: fix regression around parsing multi-line history entries History files touched by an afflicted zsh with EXTENDED_HISTORY set will be slightly corrupt: when zsh rewrites the mis-parsed history with the extended metadata at the start of each line, since it (wrongly) thought each line was a separate command. diff --git a/Src/hist.c b/Src/hist.c index 64f88f5..359e89d 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -2308,8 +2308,7 @@ readhistline(int start, char **bufp, int *bufsiz, FILE *in) } else { buf[len - 1] = '\0'; - if (len > 1 && buf[len - 2] == '\\' && - (len < 3 || buf[len - 3] != '\\')) { + if (len > 1 && buf[len - 2] == '\\') { buf[--len - 1] = '\n'; if (!feof(in)) return readhistline(len, bufp, bufsiz, in);