Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ${(z)} split of unmatched, doubled ((
- X-seq: zsh-workers 36668
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: ${(z)} split of unmatched, doubled ((
- Date: Mon, 28 Sep 2015 01:55:31 +0000
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=RnkQknIgWy4aWGfjdt0EZ7Qv+x4=; b=JYcdrQ 8nj23FYC/LeunKemRmZgDRxFtY03fsywWFQrt3sL87Q7NozUClHIj4mw5KWDCTbP Cst1J6HZylxkYBhhVc2oqveFh3AgBeyD/Fl/Nr9Bn1Mrs/8eswtdW6CV3WyaUpA9 iyltRsFfcQahXmKs0/cBLeziOr2W6H47MEPcw=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=RnkQknIgWy4aWGfjdt0EZ7Qv+x4=; b=mPbeO o0oCX7P6HkHBULFJ1dVGcinv+fvoN03i3RykTzMCZPXexPaFsv/BigmG38ZC52J5 iBZL0OMbfQTkfIffuPTQPqS9BGOJ0WKCPHao1EQtvm9GMW2EiNQxVIPy3YsBFn8O VbC181KvWY/Ujd4EeNksxTSflasaLKV5abIKzc=
- In-reply-to: <150927175906.ZM20369@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: <20150927012337.GD1989@tarsus.local2> <150927090048.ZM25706@torch.brasslantern.com> <20150927235106.GD1879@tarsus.local2> <150927175906.ZM20369@torch.brasslantern.com>
Bart Schaefer wrote on Sun, Sep 27, 2015 at 17:59:06 -0700:
> So perhaps this:
>
> +++ b/Src/lex.c
> @@ -785,6 +785,8 @@ gettok(void)
> default:
> + if (lexflags & LEXFLAGS_ACTIVE)
> + tokstr = dyncat("((", tokstr);
> return LEXERR;
LGTM: I've tested it both manually and under zsh-syntax-highlighting,
and it's an improvement in both cases.
>
> It might be prudent to also test that tokstr != NULL there, but I have
> not found a sample input where that occurs.
The failure mode when tokstr is NULL is calling strlen/strcpy on a NULL
argument, which is formally undefined behaviour and practically will
probably just segfault. If we can't prove that tokstr is always
non-NULL, I would vote to test it for NULL before using it.
Thanks,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author