Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Fix loading of multi-line history entires from disk
- X-seq: zsh-workers 32879
- From: Augie Fackler <raf@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Fix loading of multi-line history entires from disk
- Date: Thu, 17 Jul 2014 08:58:41 -0400
- 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=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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 <raf@xxxxxxxxxxx>
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);
Messages sorted by:
Reverse Date,
Date,
Thread,
Author