From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3482 invoked from network); 26 Feb 2009 08:52:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 26 Feb 2009 08:52:09 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 37153 invoked from network); 26 Feb 2009 08:52:01 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 26 Feb 2009 08:52:01 -0000 Received: (qmail 13004 invoked by alias); 26 Feb 2009 08:51:57 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26610 Received: (qmail 9687 invoked from network); 26 Feb 2009 08:45:16 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 26 Feb 2009 08:45:16 -0000 Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by bifrost.dotsrc.org (Postfix) with ESMTP id D4A9D8058F83 for ; Thu, 26 Feb 2009 09:45:10 +0100 (CET) Received: by ey-out-2122.google.com with SMTP id d26so108516eyd.3 for ; Thu, 26 Feb 2009 00:45:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:x-mailer:mime-version:content-type; bh=HFGoA3GOyuxLIF9EdhzOc9jY5L7mZ3jfwebxSjzkJm8=; b=dOvvc7Gh3DQ5OkRxdSxbKZrRaRy0PmDCg35EETywjyvK7vc14sOzJoY7VYxzFaFM/g SoY0gZDr2hJBhLolB6ZkCHve33K1HdsQ1fuZnkT5+851mcHpjxoqQ3XWnVpvf/C9+Qn7 k7SR+7aA8ik5A7IbLr2NSaxQleYubl9j8vezM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:x-mailer:mime-version:content-type; b=L9y1aFN0iqiycamr4LYI8NfOQIl2ctHcWvARUakXCRVBlip5L3z1gtaLk4akSAU/NG aS7T5ymK1DEtLJwK4MJ9IkvOFZABDn6+7XDbK0byWJagMGbkWaKR7n460vmNZ5q4/uqi KuiK+3FNHrFOnH2ZdPHbzsFJikEoAw5X2RpT4= Received: by 10.210.42.13 with SMTP id p13mr724226ebp.10.1235637910230; Thu, 26 Feb 2009 00:45:10 -0800 (PST) Received: from localhost.localdomain (nat-pool-brq.redhat.com [62.40.79.66]) by mx.google.com with ESMTPS id 7sm2834865eyg.47.2009.02.26.00.45.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 26 Feb 2009 00:45:09 -0800 (PST) Date: Thu, 26 Feb 2009 09:45:07 +0100 From: =?UTF-8?B?VG9tw6HFoQ==?= Smetana To: zsh-workers@sunsite.dk Subject: PATCH: Error parsing $(...) Message-ID: <20090226094507.43cf3c16@gmail.com> X-Mailer: Claws Mail 3.6.0 (GTK+ 2.14.5; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/7.eMX8lhMiz/lep8jmaaKVl" X-Virus-Scanned: ClamAV 0.92.1/9048/Wed Feb 25 22:08:29 2009 on bifrost X-Virus-Status: Clean --MP_/7.eMX8lhMiz/lep8jmaaKVl Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, I have stumbled upon a problem with comments in $(...) construct. Consider the following script: # Comment containing ' VAR=$( echo a # Comment containing ' ) echo $VAR This is syntactically correct but zsh would throw an error parsing it: parse error near `VAR=$(' Note that the same script works OK in ksh or bash. It seems that the '\'' character doesn't lose its special meaning even though it appears in the comment. I have written a patch (attached) which seems to fix the problem. Could you please review the patch and consider applying it? Please cc: me in the answers I'm not subscribed. Thanks and regards, Tomas Smetana --MP_/7.eMX8lhMiz/lep8jmaaKVl Content-Type: text/x-patch; name=zsh-subcomm.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=zsh-subcomm.patch Index: Src/lex.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/lex.c,v retrieving revision 1.49 diff -u -r1.49 lex.c --- Src/lex.c 25 Feb 2009 10:24:01 -0000 1.49 +++ Src/lex.c 26 Feb 2009 08:28:08 -0000 @@ -1854,6 +1854,11 @@ else add(c); break; + case '#': + add(c); + while ((c = hgetc()) != '\n' && !lexstop) + add(c); + break; } } while (pct); --MP_/7.eMX8lhMiz/lep8jmaaKVl--