From: German Riano <griano@yahoo.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Mikael Magnusson <mikachu@gmail.com>,
"zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: PATCH: Improve quote handling in _ant completion
Date: Thu, 30 Nov 2023 01:28:38 +0000 (UTC) [thread overview]
Message-ID: <403965551.9922046.1701307718781@mail.yahoo.com> (raw)
In-Reply-To: <CAH+w=7ZuSdf5YuT0JnZpQ4_2f0ytiaOxS8Yh-=ZcAeg+Wm1KUA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]
Sorry, I mean '-r', not '-q'. In other words, this seems to work: 'print -rn "'$ln' ". But (qq) looks better
On Wednesday, November 29, 2023 at 04:52:48 PM PST, Bart Schaefer <schaefer@brasslantern.com> wrote:
On Wed, Nov 29, 2023 at 4:15 PM German Riano <griano@yahoo.com> wrote:
>
> Even just using 'print -qn' works.
Er, what?
% print -qn foo
print: bad option: -q
Do you mean "printf %q ..." ?
> Questions:
> 1. Is "${(qq):-$ln} equivalent to "${(qq)ln} ?
Yes. I left it with the ":-" because in the other case there's a
trailing space inside the right brace (ultimately, inside the right
single-quote) and I thought one might be needed here as well.
> 2. Does the read command needs '-r' ?
I don't think so, the backslashes will already have been removed by
"eval" ... but perhaps if there's actually a literal backslash in the
target name, yes.
> 3. Does using eval creates the risk of arbitrary execution of code?
It does as written before any of these patches, because a target name
could embed matched pairs of single quotes and $(...) in such a way
that the eval would run the substitution.
I think fixing the inner-single-quoting via (qq) removes that
possibility, but it would still be better not to need the eval.
[-- Attachment #2: Type: text/html, Size: 2760 bytes --]
next prev parent reply other threads:[~2023-11-30 1:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <207461559.9336309.1701221332233.ref@mail.yahoo.com>
2023-11-29 1:28 ` German Riano
2023-11-29 19:18 ` Bart Schaefer
2023-11-29 19:19 ` Bart Schaefer
2023-11-29 19:56 ` Mikael Magnusson
2023-11-29 23:44 ` Bart Schaefer
2023-11-30 0:15 ` German Riano
2023-11-30 0:52 ` Bart Schaefer
2023-11-30 1:28 ` German Riano [this message]
2023-11-30 2:40 ` Bart Schaefer
2023-12-01 19:20 ` German Riano
2023-12-02 23:21 ` Bart Schaefer
2023-12-02 23:31 ` Bart Schaefer
2023-12-03 21:08 ` Oliver Kiddle
2023-12-04 0:05 ` Bart Schaefer
2023-12-04 0:11 ` Bart Schaefer
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=403965551.9922046.1701307718781@mail.yahoo.com \
--to=griano@yahoo.com \
--cc=mikachu@gmail.com \
--cc=schaefer@brasslantern.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).