Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: "zstyle -L" doesn't quote properly
- X-seq: zsh-workers 48432
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: "zstyle -L" doesn't quote properly
- Date: Wed, 07 Apr 2021 20:21:52 +0100
- Archived-at: <https://zsh.org/workers/48432>
- In-reply-to: <d1aa68f7-3a84-4ccf-834f-a0b672ee48a6@www.fastmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7bNbz97RzMQNyAVjgzVtSQotwwfSFNb1c2p7-0vPFjMuQ@mail.gmail.com> <20210407173622.GD6316@tarpaulin.shahaf.local2> <CAH+w=7Yn-00MXgSPGtMcKuOkiLE9G5DxixQwuYDdBRQz86G-jQ@mail.gmail.com> <d1aa68f7-3a84-4ccf-834f-a0b672ee48a6@www.fastmail.com>
On Wed, 2021-04-07 at 18:24 +0000, Daniel Shahaf wrote:
> Bart Schaefer wrote on Wed, 07 Apr 2021 18:12 +00:00:
> > On Wed, Apr 7, 2021 at 10:36 AM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > >
> > > I'll go ahead and commit it, but whoever is working on a fix, feel free
> > > to tweak/extend it as needed.
> >
> > I don't know how soon I'd be able to look at a fix, but there are two
> > ways we could go here: One, change the quoting for -L, or two, change
> > the code that defines styles to prohibit strings that need quoting in
> > that syntactic position.
>
> I assumed we'd take the former option and wrote the test accordingly,
> but if we decide on some behaviour other than what the test expects, we
> can adjust it accordingly.
Using the same function as everywhere else in that neighbourhood, we get
zstyle -e ':completion::*:default' $'[[ $WIDGET =\n(|reverse-)menu-complete ]] && reply=(menu yes select interactive)'
is that OK? If so it's just a question of updating the test.
./V05styles.ztst: starting.
Test ./V05styles.ztst was expected to fail, but passed.
Was testing: zstyle -L escapes the key (regression: workers/48424)
./V05styles.ztst: test XPassed.
pws
diff --git a/Src/Modules/zutil.c b/Src/Modules/zutil.c
index cecea6d51..691ba6c2f 100644
--- a/Src/Modules/zutil.c
+++ b/Src/Modules/zutil.c
@@ -200,7 +200,8 @@ printstylenode(HashNode hn, int printflags)
else {
printf("zstyle %s", (p->eval ? "-e " : ""));
quotedzputs(p->pat, stdout);
- printf(" %s", s->node.nam);
+ putchar(' ');
+ quotedzputs(s->node.nam, stdout);
}
for (v = p->vals; *v; v++) {
putchar(' ');
Messages sorted by:
Reverse Date,
Date,
Thread,
Author