From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9775 invoked by alias); 28 Sep 2015 03:30:37 -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: 36669 Received: (qmail 16272 invoked from network); 28 Sep 2015 03:30:37 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=QdlixrVppKIia2UEnRIUz0mFWKrycb/fpZrPdsxzMaM=; b=gt8+XWHQrI3zrSEMwzyGLVwwivAnsQEZ0zoZaeKMEN5LTrQKsrlvkqiplClUZgX519 H0pV1tXtEm10WW7EbEA5a/uXQDzjiLuHRK2Vk8q8Acyuj9NVtTQBEkJ1HVoy7So7Vdgo C74ogw2Ic9KUP2N0srxqAQ5O+qnN6hJcVs4sSR4qL559yMmYyWyXBdk+9w6RNM43pmDy nu0/0m5R2SuiXLrH3MykzaeP56LUORJqkv1CsZhBLE+yp83pVH30zWJFpJCZpg4q2Ndq RwKe1tC7qDUP5jyAZ8V4sgiixUZSTM76ToQODvO2hB9gG88ViCY3eXu8P7C7uVBVHWXK HfKA== X-Gm-Message-State: ALoCoQkL49xQCY3jux1bAHgPYDYCr6CZ3NEm1NT7AvJUrfRZ4KjDYtAqLpK+M4PmGbDh6VzR3IbS X-Received: by 10.202.199.197 with SMTP id x188mr9167018oif.121.1443411035593; Sun, 27 Sep 2015 20:30:35 -0700 (PDT) From: Bart Schaefer Message-Id: <150927203033.ZM20640@torch.brasslantern.com> Date: Sun, 27 Sep 2015 20:30:33 -0700 In-Reply-To: <20150928015531.GF1879@tarsus.local2> Comments: In reply to Daniel Shahaf "Re: ${(z)} split of unmatched, doubled ((" (Sep 28, 1:55am) References: <20150927012337.GD1989@tarsus.local2> <150927090048.ZM25706@torch.brasslantern.com> <20150927235106.GD1879@tarsus.local2> <150927175906.ZM20369@torch.brasslantern.com> <20150928015531.GF1879@tarsus.local2> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: ${(z)} split of unmatched, doubled (( MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 28, 1:55am, Daniel Shahaf wrote: } } If we can't prove that tokstr is always } non-NULL, I would vote to test it for NULL before using it. OK, I'm going to commit it like this; diff --git a/Src/lex.c b/Src/lex.c index 70f3d14..89af961 100644 --- a/Src/lex.c +++ b/Src/lex.c @@ -783,6 +783,15 @@ gettok(void) */ tokstr = NULL; return INPAR; + + case CMD_OR_MATH_ERR: + /* + * LEXFLAGS_ACTIVE means we came from bufferwords(), + * so we treat as an incomplete math expression + */ + if (lexflags & LEXFLAGS_ACTIVE) + tokstr = dyncat("((", tokstr ? tokstr : ""); + /* fall through */ default: return LEXERR;