From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id CAA09623 for ; Wed, 24 Jul 1996 02:29:49 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id MAA14706; Tue, 23 Jul 1996 12:24:53 -0400 (EDT) Resent-Date: Tue, 23 Jul 1996 12:24:53 -0400 (EDT) From: "Bart Schaefer" Message-Id: <960723092557.ZM2043@candle.brasslantern.com> Date: Tue, 23 Jul 1996 09:25:57 -0700 In-Reply-To: Zoltan Hidvegi "Re: Bug in case stmt with '('" (Jul 23, 4:08pm) References: <199607231408.QAA11293@bolyai.cs.elte.hu> Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.702 02jul96) To: A.Main@dcs.warwick.ac.uk (Zefram), Zoltan Hidvegi Subject: Re: Bug in case stmt with '(' Cc: segal@morgan.com, zsh-workers@math.gatech.edu (Zsh workers list) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"0S7vw1.0.ib3.LpFzn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1743 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jul 23, 4:08pm, Zoltan Hidvegi wrote: } Subject: Re: Bug in case stmt with '(' } } The best would be to handle it in glob.c but here it is a problem how can } we distinguish ( foo\ | bar ) from ( foo | bar ). The `if (incasepat && ...)' patch that I sent handles this correctly. The only drawback I've found so far to my patch is that if you *don't* use the POSIX balanced-parens syntax for "case", then parenthesized patterns can't have *meaningful* spaces in them. I don't think this is a significant difficulty, since "case" already has the `|' syntax so there's not much reason to use glob-grouping parens in "case" patterns in the first place. } The simplest solution is to convert every unquoted space } and TAB which is inside a globbing paren to a null-space and null-tab token } and later in glob.c a null-space or null-tab is either treated as space/tab } or discarded if it is adjacent to | or comes after a `(' of before a `)' } (or it may be better to disard these after `)' and before `(' as well). } } This seems to be a quite simple solution. Maybe, but not simpler than mine, and it's solving a problem that I don't think we ought to be solving -- we don't need to be able to ignore spaces in generalized glob patterns, only in "case" statements. I don't like the suggestion to do it everywhere. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lantern New male in /home/schaefer: >N 2 Justin William Schaefer Sat May 11 03:43 53/4040 "Happy Birthday"