From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: PATCH: quote parameter expansion from GLOB_SUBST
Date: Fri, 15 May 2015 09:46:14 +0100 [thread overview]
Message-ID: <20150515094614.727b76e8@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <25543.1431640232@thecus.kiddle.eu>
On Thu, 14 May 2015 23:50:32 +0200
Oliver Kiddle <okiddle@yahoo.co.uk> wrote:
> On 10 May, Peter wrote:
> > the (b) parameter flag to backslash-quote against pattern characters
>
> Playing with this, I managed to get a BUG message:
>
> % a='*'
> % echo ${(bqq)a}
> utils.c:5104: BUG: bad quote type in quotestring
> '*'
I tested one way round (q first) but not the other.
> We've got (q-) for minimal quoting. If - is a sort of parameter to q,
> perhaps we should continue that: (q*) might be more memorable. And
> combining (b) with (q) is a bit odd anyway.
I thought about an argument to q, but nothing struck me as particularly
obvious, so I left q for generic quoting (all forms produced by any q
variant at the moment protect all characters by some means or another so
are e.g. eval safe --- up to bugs).
pws
diff --git a/Src/subst.c b/Src/subst.c
index bf80495..6345e36 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -1845,7 +1845,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags)
break;
case 'q':
- if (quotetype == QT_DOLLARS)
+ if (quotetype == QT_DOLLARS || QT_BACKSLASH_PATTERN)
goto flagerr;
if (s[1] == '-') {
if (quotemod)
next prev parent reply other threads:[~2015-05-15 8:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-09 23:44 Peter Stephenson
2015-05-10 16:07 ` Daniel Shahaf
2015-05-10 18:59 ` Peter Stephenson
2015-05-12 5:16 ` Jun T.
2015-05-12 7:04 ` Jun T.
2015-05-14 21:50 ` Oliver Kiddle
2015-05-15 8:46 ` Peter Stephenson [this message]
2015-05-15 8:54 ` Peter Stephenson
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=20150515094614.727b76e8@pwslap01u.europe.root.pri \
--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).