From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3349 invoked by alias); 21 Apr 2012 17:44:30 -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: 30433 Received: (qmail 21990 invoked from network); 21 Apr 2012 17:44:29 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <120421104359.ZM10613@torch.brasslantern.com> Date: Sat, 21 Apr 2012 10:43:59 -0700 In-reply-to: <4F92E2B9.1040602@gmail.com> Comments: In reply to Hauke Petersen "Lines ending with two backslashes are incorrectly read from history file" (Apr 21, 6:39pm) References: <4F92E2B9.1040602@gmail.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Hauke Petersen , zsh-workers@zsh.org Subject: Re: Lines ending with two backslashes are incorrectly read from history file MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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);