From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23194 invoked from network); 6 Jul 2001 09:18:26 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 6 Jul 2001 09:18:26 -0000 Received: (qmail 29503 invoked by alias); 6 Jul 2001 09:17:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15277 Received: (qmail 29479 invoked from network); 6 Jul 2001 09:17:20 -0000 Message-ID: To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: Test Failures Latest CVS In-reply-to: ""Bart Schaefer""'s message of "Fri, 06 Jul 2001 05:51:58 -0000." <1010706055158.ZM9723@candle.brasslantern.com> Date: Fri, 06 Jul 2001 10:17:50 +0100 From: Peter Stephenson "Bart Schaefer" wrote: > The question is, -should- it have been changed? > ... difficult to understand ... > ... This seems backwards to me. ... > ... always before it has been the case ... One real bug turned up here, at least. This is after removing that patch. % foo='where i walked lizards wandered here and there around' % print ${(S)foo%%(#b)(h*e)} where i walked lizards wandered here and t around % print ${foo[$mbegin,$mend]} ere % print $mbegin -10 % print $mend -7 Those should always be positive; the fact they appear close to correct when counting backwards is a coincidence. Index: Src/glob.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/glob.c,v retrieving revision 1.19 diff -u -r1.19 glob.c --- Src/glob.c 2001/07/06 09:03:48 1.19 +++ Src/glob.c 2001/07/06 09:14:49 @@ -2236,16 +2236,17 @@ break; case (SUB_END|SUB_SUBSTR): - /* Shortest at end with substrings */ - patoffset = ml; - set_pat_start(p, l); - if (pattry(p, s + l) && !--n) { - *sp = get_match_ret(*sp, l, l, fl, replstr); - patoffset = 0; - return 1; - } /* fall through */ case (SUB_END|SUB_LONG|SUB_SUBSTR): /* Longest/shortest at end, matching substrings. */ + patoffset = ml; + if (!(fl & SUB_LONG)) { + set_pat_start(p, l); + if (pattry(p, s + l) && !--n) { + *sp = get_match_ret(*sp, l, l, fl, replstr); + patoffset = 0; + return 1; + } + } patoffset--; for (t = s + l - 1; t >= s; t--, patoffset--) { if (t > s && t[-1] == Meta) -- Peter Stephenson Software Engineer CSR Ltd., Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************