From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29063 invoked from network); 26 Mar 2004 04:11:14 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 26 Mar 2004 04:11:14 -0000 Received: (qmail 13502 invoked by alias); 26 Mar 2004 04:11:07 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19694 Received: (qmail 22560 invoked from network); 26 Mar 2004 01:56:06 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 26 Mar 2004 01:56:06 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.225.247.86] by sunsite.dk (MessageWall 1.0.8) with SMTP; 26 Mar 2004 1:56:6 -0000 Received: (qmail 27843 invoked from network); 26 Mar 2004 01:56:05 -0000 Received: from granger.mail.mindspring.net (207.69.200.148) by a.mx.sunsite.dk with SMTP; 26 Mar 2004 01:56:04 -0000 Received: from user-33qt1m7.dialup.mindspring.com ([199.174.134.199]) by granger.mail.mindspring.net with esmtp (Exim 3.33 #1) id 1B6gZm-0006mE-00 for zsh-workers@sunsite.dk; Thu, 25 Mar 2004 20:56:02 -0500 From: Jonathan Hankins To: zsh-workers@sunsite.dk Subject: Subscript of negatively-subscripted array element gives incorrect result Date: Thu, 25 Mar 2004 19:56:00 -0600 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200403251956.00439.jonathan-hankins@mindspring.com> X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: * X-Spam-Status: No, hits=1.6 required=6.0 tests=RCVD_IN_NJABL,RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: 1.6 Hi, I reported this previously through the Bugs section on the Sourceforge page for zsh, but wasn't sure if it was active. I also have a bit more information. I am getting different results taking a substring of the same array element when I index it negatively than when I index it positively. Here is an example: These are correct: % t=(foo bar baz) % print ${t[2]} bar % print ${${t[2]}[1]} b % print ${${t[2]}[1,2]} ba % print ${${t[2]}[2]} a % print ${${t[2]}[2,3]} ar % This is also correct: % print ${t[-2]} bar These are not correct: % print ${${t[-2]}[1]} bar % print ${${t[-2]}[1,2]} bar % print ${${t[-2]}[2]} % print ${${t[-2]}[2,3]} % Those last 2 yield an empty string. I verified this behavior with 4.0.4, 4.0.9, 4.1.1 and 4.2.0 on a Debian GNU/Linux system. Thanks! -Jonathan Hankins