From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [130.207.244.244]) by werple.mira.net.au (8.6.12/8.6.9) with SMTP id TAA13013 for ; Thu, 15 Jun 1995 19:00:04 +1000 Received: from math (math.skiles.gatech.edu) by gatech.edu with SMTP id AA16924 (5.65c/Gatech-10.0-IDA for ); Thu, 15 Jun 1995 04:56:18 -0400 Received: by math (5.x/SMI-SVR4) id AA07687; Thu, 15 Jun 1995 04:54:07 -0400 Resent-Date: Thu, 15 Jun 95 09:53:40 +0100 Old-Return-Path: Message-Id: <18869.9506150853@pyro.swan.ac.uk> To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: Re: glob.c with comments In-Reply-To: "P.Stephenson@swansea.ac.uk"'s message of "Wed, 14 Jun 95 16:59:01 BST." <26244.9506141559@pyro.swan.ac.uk> Date: Thu, 15 Jun 95 09:53:40 +0100 From: P.Stephenson@swansea.ac.uk X-Mts: smtp Resent-Message-Id: <"ETNpv3.0.zt1.kK_tl"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/104 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu P.Stephenson@swansea.ac.uk wrote: > One thing I noticed is that the code that handled {a-z} doesn't check > for commas before or after the dash, so > > % print -c foo{,-A} > foo, foo. foo0 foo2 foo4 foo6 foo8 foo: foo< foo> foo@ > foo- foo/ foo1 foo3 foo5 foo7 foo9 foo; foo= foo? fooA I had a request to fix this. Here's a diff against the new glob.c I posted. (I just replied to myself instead of the list. I'm not getting used to this very quickly.) *** Src/glob.c~ Wed Jun 14 16:18:42 1995 --- Src/glob.c Thu Jun 15 09:50:15 1995 *************** *** 1011,1020 **** *np = nextnode(last); return; } ! if (str[2] == '-' && str[3] && str[4] == Outbrace) { /* {a-z} */ /* Now any other ranges present: note this only happens ! * for a pattern like {-}, but it happens for ANY ! * character , so {,-z} does this (possibly a bug). */ char c1, c2; --- 1011,1021 ---- *np = nextnode(last); return; } ! if (str[2] == '-' && str[3] && str[4] == Outbrace ! && str[1] != Comma && str[3] != Comma) { /* {a-z} */ /* Now any other ranges present: note this only happens ! * for a pattern like {-}. should not ! * be a tokenised comma. */ char c1, c2; -- Peter Stephenson Tel: +44 1792 205678 extn. 4461 WWW: http://python.swan.ac.uk/~pypeters/ Fax: +44 1792 295324 Department of Physics, University of Wales, Swansea, Singleton Park, Swansea, SA2 8PP, U.K.