zsh-users
 help / color / mirror / code / Atom feed
* Bug in handling combination of extended globs and attributes
@ 2010-12-02 11:25 Klaus Ethgen
  2010-12-02 12:35 ` Mikael Magnusson
  2010-12-02 12:44 ` Peter Stephenson
  0 siblings, 2 replies; 7+ messages in thread
From: Klaus Ethgen @ 2010-12-02 11:25 UTC (permalink / raw)
  To: zsh-users

Hello,

when I use the following glob:
   print -l *~bla~foo(D.|/)

I get a list with only bla excluded. File/Directory foo is still in the
result but shouldnt with my understanding.

(zsh Version 4.3.4)

-- Klaus
-- 
Klaus Ethgen                            http://www.ethgen.de/
pub  2048R/D1A4EDE5 2000-02-26 Klaus Ethgen <Klaus@Ethgen.de>
Fingerprint: D7 67 71 C4 99 A6 D4 FE  EA 40 30 57 3C 88 26 2B


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug in handling combination of extended globs and attributes
  2010-12-02 11:25 Bug in handling combination of extended globs and attributes Klaus Ethgen
@ 2010-12-02 12:35 ` Mikael Magnusson
  2010-12-02 12:52   ` Peter Stephenson
                     ` (2 more replies)
  2010-12-02 12:44 ` Peter Stephenson
  1 sibling, 3 replies; 7+ messages in thread
From: Mikael Magnusson @ 2010-12-02 12:35 UTC (permalink / raw)
  To: Klaus Ethgen; +Cc: zsh-users

On 2 December 2010 12:25, Klaus Ethgen <klaus+usenet@ethgen.de> wrote:
> Hello,
>
> when I use the following glob:
>   print -l *~bla~foo(D.|/)
>
> I get a list with only bla excluded. File/Directory foo is still in the
> result but shouldnt with my understanding.

Glob qualifier groups are separated by commas (,), not pipes (|). The
pipe probably makes the () portion be interpreted as a pattern, ie
you're excluding 'fooD.' and 'foo/' instead of 'foo'.

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug in handling combination of extended globs and attributes
  2010-12-02 11:25 Bug in handling combination of extended globs and attributes Klaus Ethgen
  2010-12-02 12:35 ` Mikael Magnusson
@ 2010-12-02 12:44 ` Peter Stephenson
  2010-12-02 19:16   ` Peter Stephenson
  1 sibling, 1 reply; 7+ messages in thread
From: Peter Stephenson @ 2010-12-02 12:44 UTC (permalink / raw)
  To: Klaus Ethgen, zsh-users

On Thu, 2 Dec 2010 12:25:29 +0100
Klaus Ethgen <klaus+usenet@ethgen.de> wrote:
> when I use the following glob:
>    print -l *~bla~foo(D.|/)
> 
> I get a list with only bla excluded. File/Directory foo is still in
> the result but shouldnt with my understanding.

Yes, it's explicitly documented that way and for some reason I didn't
see that and didn't implement it that way when I rewrote the pattern
matching code some years ago.  In fact, I can't work out what chaining
tilde expressions actually does at the moment.  I'll see if I can
remember enough to fix it.

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug in handling combination of extended globs and attributes
  2010-12-02 12:35 ` Mikael Magnusson
@ 2010-12-02 12:52   ` Peter Stephenson
  2010-12-02 14:43   ` Klaus Ethgen
  2010-12-02 14:44   ` Klaus Ethgen
  2 siblings, 0 replies; 7+ messages in thread
From: Peter Stephenson @ 2010-12-02 12:52 UTC (permalink / raw)
  To: Klaus Ethgen, zsh-users

On Thu, 2 Dec 2010 13:35:43 +0100
Mikael Magnusson <mikachu@gmail.com> wrote:
> On 2 December 2010 12:25, Klaus Ethgen <klaus+usenet@ethgen.de> wrote:
> > Hello,
> >
> > when I use the following glob:
> >   print -l *~bla~foo(D.|/)
> >
> > I get a list with only bla excluded. File/Directory foo is still in
> > the result but shouldnt with my understanding.
> 
> Glob qualifier groups are separated by commas (,), not pipes (|). The
> pipe probably makes the () portion be interpreted as a pattern, ie
> you're excluding 'fooD.' and 'foo/' instead of 'foo'.

Er, you're quite right, it does basically work, and there's a test for
it in the test suite, it's just my fiddling with patterns to try it out
that's flaky.

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK




Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug in handling combination of extended globs and attributes
  2010-12-02 12:35 ` Mikael Magnusson
  2010-12-02 12:52   ` Peter Stephenson
@ 2010-12-02 14:43   ` Klaus Ethgen
  2010-12-02 14:44   ` Klaus Ethgen
  2 siblings, 0 replies; 7+ messages in thread
From: Klaus Ethgen @ 2010-12-02 14:43 UTC (permalink / raw)
  To: zsh-users

Hi,

Mikael Magnusson <mikachu@gmail.com> schrieb:
>> when I use the following glob:
>>   print -l *~bla~foo(D.|/)
>>
>> I get a list with only bla excluded. File/Directory foo is still in the
>> result but shouldnt with my understanding.
>
> Glob qualifier groups are separated by commas (,), not pipes (|). The
> pipe probably makes the () portion be interpreted as a pattern, ie
> you're excluding 'fooD.' and 'foo/' instead of 'foo'.

Uhm, yes, affirmed.

With comma it works as desired.

-- Klaus
-- 
Klaus Ethgen                            http://www.ethgen.de/
pub  2048R/D1A4EDE5 2000-02-26 Klaus Ethgen <Klaus@Ethgen.de>
Fingerprint: D7 67 71 C4 99 A6 D4 FE  EA 40 30 57 3C 88 26 2B


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug in handling combination of extended globs and attributes
  2010-12-02 12:35 ` Mikael Magnusson
  2010-12-02 12:52   ` Peter Stephenson
  2010-12-02 14:43   ` Klaus Ethgen
@ 2010-12-02 14:44   ` Klaus Ethgen
  2 siblings, 0 replies; 7+ messages in thread
From: Klaus Ethgen @ 2010-12-02 14:44 UTC (permalink / raw)
  To: zsh-users

Ah yes, and please do not add me to Cc as I monitor the news group. :-)

-- Klaus
-- 
Klaus Ethgen                            http://www.ethgen.de/
pub  2048R/D1A4EDE5 2000-02-26 Klaus Ethgen <Klaus@Ethgen.de>
Fingerprint: D7 67 71 C4 99 A6 D4 FE  EA 40 30 57 3C 88 26 2B


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Bug in handling combination of extended globs and attributes
  2010-12-02 12:44 ` Peter Stephenson
@ 2010-12-02 19:16   ` Peter Stephenson
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Stephenson @ 2010-12-02 19:16 UTC (permalink / raw)
  To: zsh-users

On Thu, 2 Dec 2010 12:44:12 +0000
Peter Stephenson <Peter.Stephenson@csr.com> wrote:
> On Thu, 2 Dec 2010 12:25:29 +0100
> Klaus Ethgen <klaus+usenet@ethgen.de> wrote:
> > when I use the following glob:
> >    print -l *~bla~foo(D.|/)
> > 
> > I get a list with only bla excluded. File/Directory foo is still in
> > the result but shouldnt with my understanding.
> 
> Yes, it's explicitly documented that way and for some reason I didn't
> see that and didn't implement it that way when I rewrote the pattern
> matching code some years ago.  In fact, I can't work out what chaining
> tilde expressions actually does at the moment.  I'll see if I can
> remember enough to fix it.

Ignore this, for some reason it turned up late.

pws


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-12-02 19:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-02 11:25 Bug in handling combination of extended globs and attributes Klaus Ethgen
2010-12-02 12:35 ` Mikael Magnusson
2010-12-02 12:52   ` Peter Stephenson
2010-12-02 14:43   ` Klaus Ethgen
2010-12-02 14:44   ` Klaus Ethgen
2010-12-02 12:44 ` Peter Stephenson
2010-12-02 19:16   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).