From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17845 invoked by alias); 15 Sep 2011 12:12:56 -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: 29775 Received: (qmail 22251 invoked from network); 15 Sep 2011 12:12:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Thu, 15 Sep 2011 13:12:31 +0100 From: Peter Stephenson To: zsh workers Subject: Re: \" in $(( )) vs $[ ] Message-ID: <20110915131231.57ee6e37@pwslap01u.europe.root.pri> In-Reply-To: References: Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.103.10.104] X-Scanned-By: MailControl A-12-01-02 (www.mailcontrol.com) on 10.71.0.139 On Thu, 15 Sep 2011 12:17:44 +0200 Mikael Magnusson wrote: > % echo $(( ##\" )) > % At this point we haven't resolved between $((...)...) and $((...)), but I don't think double quote needs to be handled differently in the two cases. Index: Src/lex.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/lex.c,v retrieving revision 1.67 diff -p -u -r1.67 lex.c --- Src/lex.c 19 Jun 2011 16:26:11 -0000 1.67 +++ Src/lex.c 15 Sep 2011 12:09:27 -0000 @@ -1482,7 +1482,8 @@ dquote_parse(char endchar, int sub) (endchar == ']' && (c == '[' || c == ']' || c == '(' || c == ')' || c == '{' || c == '}' || - (c == '"' && sub)))) + (c == '"' && sub))) || + (endchar == ')' && c == '"')) add(Bnull); else { /* lexstop is implicitly handled here */ Index: Test/D08cmdsubst.ztst =================================================================== RCS file: /cvsroot/zsh/zsh/Test/D08cmdsubst.ztst,v retrieving revision 1.4 diff -p -u -r1.4 D08cmdsubst.ztst --- Test/D08cmdsubst.ztst 11 Jul 2009 16:43:01 -0000 1.4 +++ Test/D08cmdsubst.ztst 15 Sep 2011 12:09:28 -0000 @@ -98,3 +98,11 @@ echo `echo $?` 0:Non-empty command substitution inherits status >1 + + echo $(( ##\" )) + echo $(echo \") + echo $((echo \"); echo OK) +0:Handling of backslash double quote in parenthesised substitutions +>34 +>" +>" OK -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog