mirror of
https://github.com/tmux/tmux.git
synced 2024-12-04 19:58:48 +00:00
Check all %if in the list when deciding whether to process an
assignment, not just the most recent.
This commit is contained in:
parent
a854e36f2b
commit
a3ede3106a
22
cmd-parse.y
22
cmd-parse.y
@ -223,9 +223,16 @@ assignment : EQUALS
|
|||||||
{
|
{
|
||||||
struct cmd_parse_state *ps = &parse_state;
|
struct cmd_parse_state *ps = &parse_state;
|
||||||
int flags = ps->input->flags;
|
int flags = ps->input->flags;
|
||||||
|
int flag = 1;
|
||||||
|
struct cmd_parse_scope *scope;
|
||||||
|
|
||||||
if ((~flags & CMD_PARSE_PARSEONLY) &&
|
if (ps->scope != NULL) {
|
||||||
(ps->scope == NULL || ps->scope->flag))
|
flag = ps->scope->flag;
|
||||||
|
TAILQ_FOREACH(scope, &ps->stack, entry)
|
||||||
|
flag = flag && scope->flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((~flags & CMD_PARSE_PARSEONLY) && flag)
|
||||||
environ_put(global_environ, $1, 0);
|
environ_put(global_environ, $1, 0);
|
||||||
free($1);
|
free($1);
|
||||||
}
|
}
|
||||||
@ -234,9 +241,16 @@ hidden_assignment : HIDDEN EQUALS
|
|||||||
{
|
{
|
||||||
struct cmd_parse_state *ps = &parse_state;
|
struct cmd_parse_state *ps = &parse_state;
|
||||||
int flags = ps->input->flags;
|
int flags = ps->input->flags;
|
||||||
|
int flag = 1;
|
||||||
|
struct cmd_parse_scope *scope;
|
||||||
|
|
||||||
if ((~flags & CMD_PARSE_PARSEONLY) &&
|
if (ps->scope != NULL) {
|
||||||
(ps->scope == NULL || ps->scope->flag))
|
flag = ps->scope->flag;
|
||||||
|
TAILQ_FOREACH(scope, &ps->stack, entry)
|
||||||
|
flag = flag && scope->flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((~flags & CMD_PARSE_PARSEONLY) && flag)
|
||||||
environ_put(global_environ, $2, ENVIRON_HIDDEN);
|
environ_put(global_environ, $2, ENVIRON_HIDDEN);
|
||||||
free($2);
|
free($2);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user