mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
Ignore empty commands rather than adding them to the command list rather
than trying to skip them later, fixes problem reported by M Kelly.
This commit is contained in:
parent
a6129e9974
commit
e388702260
10
cmd-parse.y
10
cmd-parse.y
@ -341,7 +341,8 @@ commands : command
|
|||||||
struct cmd_parse_state *ps = &parse_state;
|
struct cmd_parse_state *ps = &parse_state;
|
||||||
|
|
||||||
$$ = cmd_parse_new_commands();
|
$$ = cmd_parse_new_commands();
|
||||||
if (ps->scope == NULL || ps->scope->flag)
|
if ($1->name != NULL &&
|
||||||
|
(ps->scope == NULL || ps->scope->flag))
|
||||||
TAILQ_INSERT_TAIL($$, $1, entry);
|
TAILQ_INSERT_TAIL($$, $1, entry);
|
||||||
else
|
else
|
||||||
cmd_parse_free_command($1);
|
cmd_parse_free_command($1);
|
||||||
@ -360,7 +361,8 @@ commands : command
|
|||||||
{
|
{
|
||||||
struct cmd_parse_state *ps = &parse_state;
|
struct cmd_parse_state *ps = &parse_state;
|
||||||
|
|
||||||
if (ps->scope == NULL || ps->scope->flag) {
|
if ($3->name != NULL &&
|
||||||
|
(ps->scope == NULL || ps->scope->flag)) {
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
TAILQ_INSERT_TAIL($$, $3, entry);
|
TAILQ_INSERT_TAIL($$, $3, entry);
|
||||||
} else {
|
} else {
|
||||||
@ -641,8 +643,6 @@ cmd_parse_build_commands(struct cmd_parse_commands *cmds,
|
|||||||
* command list.
|
* command list.
|
||||||
*/
|
*/
|
||||||
TAILQ_FOREACH_SAFE(cmd, cmds, entry, next) {
|
TAILQ_FOREACH_SAFE(cmd, cmds, entry, next) {
|
||||||
if (cmd->name == NULL)
|
|
||||||
continue;
|
|
||||||
alias = cmd_get_alias(cmd->name);
|
alias = cmd_get_alias(cmd->name);
|
||||||
if (alias == NULL)
|
if (alias == NULL)
|
||||||
continue;
|
continue;
|
||||||
@ -688,8 +688,6 @@ cmd_parse_build_commands(struct cmd_parse_commands *cmds,
|
|||||||
*/
|
*/
|
||||||
result = cmd_list_new();
|
result = cmd_list_new();
|
||||||
TAILQ_FOREACH(cmd, cmds, entry) {
|
TAILQ_FOREACH(cmd, cmds, entry) {
|
||||||
if (cmd->name == NULL)
|
|
||||||
continue;
|
|
||||||
log_debug("%s: %u %s", __func__, cmd->line, cmd->name);
|
log_debug("%s: %u %s", __func__, cmd->line, cmd->name);
|
||||||
cmd_log_argv(cmd->argc, cmd->argv, __func__);
|
cmd_log_argv(cmd->argc, cmd->argv, __func__);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user