From: Bart Schaefer <schaefer@brasslantern.com>
To: Hauke Petersen <hkptrsn@googlemail.com>, zsh-workers@zsh.org
Subject: Re: Lines ending with two backslashes are incorrectly read from history file
Date: Sat, 21 Apr 2012 10:43:59 -0700 [thread overview]
Message-ID: <120421104359.ZM10613@torch.brasslantern.com> (raw)
In-Reply-To: <4F92E2B9.1040602@gmail.com>
On Apr 21, 6:39pm, Hauke Petersen wrote:
}
} I noticed a problem reading history files that contain lines ending in
} two consecutive backslashes (\\).
Does this fix it?
Index: hist.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/hist.c,v
retrieving revision 1.39
diff -c -r1.39 hist.c
--- hist.c 20 Dec 2011 17:13:38 -0000 1.39
+++ hist.c 21 Apr 2012 17:42:31 -0000
@@ -2220,7 +2225,8 @@
}
else {
buf[len - 1] = '\0';
- if (len > 1 && buf[len - 2] == '\\') {
+ if (len > 1 && buf[len - 2] == '\\' &&
+ (len < 3 || buf[len - 3] != '\\')) {
buf[--len - 1] = '\n';
if (!feof(in))
return readhistline(len, bufp, bufsiz, in);
next prev parent reply other threads:[~2012-04-21 17:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-21 16:39 Hauke Petersen
2012-04-21 17:43 ` Bart Schaefer [this message]
2012-04-21 18:09 ` Hauke Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=120421104359.ZM10613@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=hkptrsn@googlemail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).