zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: <zsh-workers@zsh.org>
Subject: Re: [BUG] Glob handling is brittle
Date: Tue, 27 Nov 2018 15:08:52 +0000	[thread overview]
Message-ID: <1543331332.4259.24.camel@samsung.com> (raw)
In-Reply-To: <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@inlv.org> 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


      reply	other threads:[~2018-11-27 15:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26  5:38 Martijn Dekker
2018-11-27 12:14 ` Jun T
2018-11-27 15:08   ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1543331332.4259.24.camel@samsung.com \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).