Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] Glob handling is brittle
- X-seq: zsh-workers 43850
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: <zsh-workers@xxxxxxx>
- Subject: Re: [BUG] Glob handling is brittle
- Date: Tue, 27 Nov 2018 15:08:52 +0000
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181127150854euoutp016fc5eb07233838d8b860a34bb84395b2~rA6wOnp-q0534405344euoutp01H
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1543331334; bh=CDo6brSSSOgpE9UCcHy9OEnpzES+ucVrIoK7dVf78og=; h=Subject:From:To:Date:In-Reply-To:References:From; b=O+aTIzrby8p3s/hJSsPSBHw8QabLDhUbWM6fwhAKv0MYL4Ayt3syc2BL0yfvIbkoJ wIxAmB4AwPR8ldLoFDWgobR2+HNmFOPSieM/1MPHz2GRs+WNNJ5JVvJMA4AM64bG0a kiVo3otCsbNeqf1vt9/yI+R5t44DjCs6UhIxvZ3U=
- In-reply-to: <942D7657-1371-4A04-B2E7-1CBFE9DC0966@kba.biglobe.ne.jp>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <4a07ef77-de18-8966-5f3e-bd544aaaae3f@inlv.org> <CGME20181127125232epcas2p2e18a287839670075febc0d5ee7a7568c@epcas2p2.samsung.com> <942D7657-1371-4A04-B2E7-1CBFE9DC0966@kba.biglobe.ne.jp>
On Tue, 2018-11-27 at 21:14 +0900, Jun T wrote:
> > 2018/11/26 14:38, Martijn Dekker <martijn@xxxxxxxx> wrote:
> > The script below reliably makes zsh hang.
> (snip)
> >
> > case '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' in
> > ( *\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\\
> > *\\*\\*\\*\\*\\*\\*\\*\\*\\*\\* )
> > echo ok ;;
> > esac
> zsh is not hanging; it is just very slow.
Yes, you can see that by gradually increasing the length of the
pattern. Depending on the machine, it starts to get really slow after
about half a dozen or so \\* groups.
> I don't know whether this can be 'fixed' easily.
There's something a bit similar that does improve the case of excluded
matches, ~ and ^ --- where you hit pathological cases quite quickly, and
which aren't so commonly used in patterns. That's not nice. It's
almost certainly not a good idea to do it that way here, as * is very
widely used indeed. I can't offhand think of a good way of fixing up
pathological cases without having a much more noticeable effect on more
typical cases. But I don't think offhand thinking is what's required
here.
Really, this is at the point where you need an algorithm expert rather
than a bunch of hackers.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author