From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5846 invoked from network); 15 Nov 1998 22:49:14 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 15 Nov 1998 22:49:14 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id RAA03659; Sun, 15 Nov 1998 17:47:49 -0500 (EST) Resent-Date: Sun, 15 Nov 1998 17:47:49 -0500 (EST) From: "Bart Schaefer" Message-Id: <981115144603.ZM29810@candle.brasslantern.com> Date: Sun, 15 Nov 1998 14:46:03 -0800 In-Reply-To: <199811042134.VAA01156@athenaeum.demon.co.uk> Comments: In reply to Phil Pennock "Arithmetic expression (bug?)" (Nov 4, 9:34pm) References: <199811042134.VAA01156@athenaeum.demon.co.uk> X-Mailer: Z-Mail (4.0b.820 20aug96) To: Phil Pennock , zsh-workers@math.gatech.edu Subject: Re: Arithmetic expression (bug?) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"HEG6u1.0.6v.LerJs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4643 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Nov 4, 9:34pm, Phil Pennock wrote: } Subject: Arithmetic expression (bug?) } } -----------------------------< cut here >------------------------------- } foo=alpha } print -- ${(l<$[10]>)foo} } print -- ${(l<10>)foo} } -----------------------------< cut here >------------------------------- } why does the third line produce: } ./testfile: error in flags [3] } ? Having just said I wasn't sure how to fix this, here's a patch that takes care of it. I'm still not sure it's the *best* patch for it .... Index: Src/subst.c =================================================================== --- subst.c 1998/11/12 09:21:35 1.2 +++ subst.c 1998/11/15 22:27:52 @@ -743,6 +743,7 @@ long num; int escapes = 0; int klen; +#define UNTOK(C) (itok(C) ? ztokens[(C) - Pound] : (C)) #define UNTOK_AND_ESCAPE(X) {\ untokenize(X = dupstring(s + 1));\ if (escapes) {\ @@ -856,7 +857,7 @@ prenum = num; else postnum = num; - if (s[1] != sav) + if (UNTOK(s[1]) != UNTOK(sav)) break; t = get_strarg(++s); if (!*t) -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com