summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-parse.y
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-09-10 08:52:47 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-09-10 08:52:47 +0000
commitad9f21665b7cdd99fec81d50da7f0922e49edcf7 (patch)
treec8df88e7c74a1216c23a37513e2c92addb2b68de /usr.bin/tmux/cmd-parse.y
parent382d203c882e459aff4bde3403ec22b2bbabfcca (diff)
Disable aliases inside aliases for the moment.
Diffstat (limited to 'usr.bin/tmux/cmd-parse.y')
-rw-r--r--usr.bin/tmux/cmd-parse.y12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd-parse.y b/usr.bin/tmux/cmd-parse.y
index 665e3e4c3e4..71ce9abcf4a 100644
--- a/usr.bin/tmux/cmd-parse.y
+++ b/usr.bin/tmux/cmd-parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-parse.y,v 1.47 2021/09/09 06:57:48 nicm Exp $ */
+/* $OpenBSD: cmd-parse.y,v 1.48 2021/09/10 08:52:46 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -749,6 +749,8 @@ cmd_parse_expand_alias(struct cmd_parse_command *cmd,
struct cmd_parse_command *last;
char *alias, *name, *cause;
+ if (pi->flags & CMD_PARSE_NOALIAS)
+ return (0);
memset(pr, 0, sizeof *pr);
first = TAILQ_FIRST(&cmd->arguments);
@@ -786,9 +788,11 @@ cmd_parse_expand_alias(struct cmd_parse_command *cmd,
TAILQ_REMOVE(&cmd->arguments, arg, entry);
TAILQ_INSERT_TAIL(&last->arguments, arg, entry);
}
- cmd_parse_log_commands(cmds, __func__);
+ cmd_parse_log_commands(cmds, __func__);
+ pi->flags |= CMD_PARSE_NOALIAS;
cmd_parse_build_commands(cmds, pi, pr);
+ pi->flags &= ~CMD_PARSE_NOALIAS;
return (1);
}
@@ -865,7 +869,7 @@ cmd_parse_build_commands(struct cmd_parse_commands *cmds,
pr->cmdlist = cmd_list_new();
return;
}
- cmd_parse_log_commands(cmds, __func__);
+ cmd_parse_log_commands(cmds, __func__);
/*
* Parse each command into a command list. Create a new command list
@@ -1422,7 +1426,7 @@ yylex_token_escape(char **buf, size_t *len)
if (o3 >= '0' && o3 <= '7') {
ch = 64 * (ch - '0') +
8 * (o2 - '0') +
- (o3 - '0');
+ (o3 - '0');
yylex_append1(buf, len, ch);
return (1);
}