Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: #% anchoring doesn't work with (S)
- X-seq: zsh-workers 51348
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: #% anchoring doesn't work with (S)
- Date: Thu, 2 Feb 2023 11:32:52 +0100
- Archived-at: <https://zsh.org/workers/51348>
- In-reply-to: <CAKc7PVBi-_jW2UZkOaxpOqUG=V+DS8sU814nVp4Yj7Su28Kqpg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAKc7PVA=Beup8-GyjpxCst0=Ne_-v1yjYqn46YuRMTRuvTpteg@mail.gmail.com> <CAKc7PVBi-_jW2UZkOaxpOqUG=V+DS8sU814nVp4Yj7Su28Kqpg@mail.gmail.com>
On 2/2/23, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
> Could the bug be fixed? It already makes #% pretty much unusable for a
> backward compatible software, yet in say 4 years this would be changed, if
> the bug would be fixed today
Why would you use (S) (shortest possible match) with #% (match the
entire string)? It will obviously never have a useful effect other
than doing nothing.
That said, compgetmatch() does this, which is probably your problem
(it gives no real motivation for why it does this)
/*
* Search is anchored to the end of the string if we want to match
* it all, or if we are matching at the end of the string and not
* using substrings.
*/
if ((*flp & SUB_ALL) || ((*flp & SUB_END) && !(*flp & SUB_SUBSTR)))
patflags &= ~PAT_NOANCH;
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author