Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: typeset -n -H
- X-seq: zsh-workers 53363
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Oliver Kiddle <opk@xxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: typeset -n -H
- Date: Wed, 12 Feb 2025 20:27:11 -0800
- Archived-at: <https://zsh.org/workers/53363>
- In-reply-to: <98757-1739291158.458303@J0dk.TjJZ.pj5i>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7aGegF=mk2oXnHod1WrdFdBtCstpHkZURvJ9YA48LwR3w@mail.gmail.com> <98757-1739291158.458303@J0dk.TjJZ.pj5i>
On Tue, Feb 11, 2025 at 8:26 AM Oliver Kiddle <opk@xxxxxxx> wrote:
>
> Should +n -m be similarly blocked because that appears to work?
I think you mean this?
diff --git a/Src/builtin.c b/Src/builtin.c
index 2fab73b24..9877c6d8f 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3053,12 +3053,11 @@ bin_typeset(char *name, char **argv, LinkList
assigns, Options ops, int func)
/* With the -m option, treat arguments as glob patterns */
if (OPT_ISSET(ops,'m')) {
if (!OPT_ISSET(ops,'p')) {
- if (on & PM_NAMEREF) {
+ if ((on & PM_NAMEREF) && OPT_MINUS(ops,'m')) {
/* It's generally unwise to mass-change the types of
* parameters, but for namerefs it would be fatal */
unqueue_signals();
- zerrnam(name, "%cm not allowed with -n",
- (OPT_PLUS(ops,'m') ? '+' : '-'));
+ zerrnam(name, "-m not allowed with -n");
return 1;
}
if (!(on|roff))
Messages sorted by:
Reverse Date,
Date,
Thread,
Author