Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why a '-quoted string isn't respected by // subst, while \-quoted is?
- X-seq: zsh-users 28830
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Cc: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Why a '-quoted string isn't respected by // subst, while \-quoted is?
- Date: Fri, 27 Jan 2023 18:43:55 +0000
- Archived-at: <https://zsh.org/users/28830>
- Feedback-id: i425e4195:Fastmail
- In-reply-to: <CAN=4vMoRdDJvoLyxB9=waegd4tZxaK+MJmwYf1g6dLPEhuk7yw@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAKc7PVCm3sSqvnCT+aHHRpsKqFq93d7gtMLHD0-sEE7ZVZ-1gw@mail.gmail.com> <CAN=4vMo6Aeia8P12-=-bh00xZnT9m7REMrMveRDSdUd9SMtfHQ@mail.gmail.com> <CAKc7PVC8DMPJJFY64sErMhdgS3mwRFe0fz5hPKJ-vuBh8bX=rg@mail.gmail.com> <CAN=4vMoRdDJvoLyxB9=waegd4tZxaK+MJmwYf1g6dLPEhuk7yw@mail.gmail.com>
Roman Perepelitsa wrote on Wed, Jan 25, 2023 at 14:10:26 +0100:
> On Wed, Jan 25, 2023 at 2:00 PM Sebastian Gniazdowski
> <sgniazdowski@xxxxxxxxx> wrote:
> >
> > Ok, I'll take a closer look, however I'm now struggling with similar problem:
> >
> > QE='0=${${(M)${0::=${(%):-%x}}:#/*}:-$PWD/$0}'
> > print ${QE//'0=${${(M)${0::=${(%):-%x}}:#/*}:-$PWD/$0}'/°match°}
> >
> > the strings in QE and in …//'…'/… are identical. Why no match?
>
> This looks like a bug in zsh. Here's a simpler test case:
>
> % x='/'
> % print -r -- ${x/'/'}
> /
>
> I expect the output to be empty but it's in fact "/".
>
> This one also looks wrong:
>
> % x=\'
> % print -r -- ${x/'/'}
>
> Here the output is empty while I expect a single quote.
XFail regression tests added in 096e72ce78ac.
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author