Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: histlexwords error with >! token
- X-seq: zsh-workers 34393
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: histlexwords error with >! token
- Date: Sun, 25 Jan 2015 21:40:01 +0100
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=d5aubLohit2irsixy9j8NTjQkL5Go1CcomZ5B+CVBUE=; b=gMNadsluD/jMys6oDgSsL9sCyjpYRDSED6XzmJbQOvJe6Lg9gbWPZVURu8ckrAq0kY wJEqqv9I+AYdBE5q/VF0UMkRP6VOEDm8vg8Eb+AbPiVNsiDBgZT53qI+4vRHeBBETlDi uoNxMSkp9W5o6h8TiD4i0rAIbsITN63di0CeyW+PgZVHXpqp1Q1zYSh0hIeZNoEK6nhA JZIUsmZvb6TO3vIa99QfyKTSjK2x9RKZ2LL4pvaoR6zoRKtZedt8O1qeTPVZoOVOAzda VnWSAyBUnvY52lrOZBO5ZpJmO+q2/C8tlkgIkcCkwNYvXigIcnJJoUYSltSl2QK3WwRm 6hww==
- In-reply-to: <150125115905.ZM31435@torch.brasslantern.com>
- 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
- References: <CAHYJk3SFKw+gUCbu9gKWKxSo_MPNm1Qcwj6xrWvZLk8N=WSXSg@mail.gmail.com> <150125115905.ZM31435@torch.brasslantern.com>
On Sun, Jan 25, 2015 at 8:59 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Jan 25, 7:52pm, Mikael Magnusson wrote:
> } Subject: histlexwords error with >! token
> }
> } Even though the code appears to specially handle it, I still get this error,
> } hist.c:3477: bad(1) wordsplit reading history: echo hello >! /dev/null
> } at: >! /dev/null
> } word: >|
>
> Try this:
>
>
> diff --git a/Src/hist.c b/Src/hist.c
> index 11d9722..87d0723 100644
> --- a/Src/hist.c
> +++ b/Src/hist.c
> @@ -3452,7 +3452,8 @@ histsplitwords(char *lineptr, short **wordsp, int *nwordsp, int *nwordposp,
> if (*lptr == *wptr ||
> (*lptr == '!' && *wptr == '|')) {
> lptr++;
> - wptr++;
> + if (!*++wptr)
> + break;
> } else if (lptr[0] == '\\' &&
> lptr[1] == '\n') {
> /*
That appears to do the trick. I also tried recalling the words with
insert-last-word and copy-earlier-word and they show up as expected
even when they contain spaces, which wasn't the case before the patch.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author