=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cfg.c,v retrieving revision 1.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- src/usr.bin/tmux/cfg.c 2021/02/22 08:18:13 1.82 +++ src/usr.bin/tmux/cfg.c 2021/04/07 12:50:12 1.83 @@ -1,4 +1,4 @@ -/* $OpenBSD: cfg.c,v 1.82 2021/02/22 08:18:13 nicm Exp $ */ +/* $OpenBSD: cfg.c,v 1.83 2021/04/07 12:50:12 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -103,6 +103,7 @@ struct cmd_parse_input pi; struct cmd_parse_result *pr; struct cmdq_item *new_item0; + struct cmdq_state *state; if (new_item != NULL) *new_item = NULL; @@ -136,12 +137,19 @@ return (0); } - new_item0 = cmdq_get_command(pr->cmdlist, NULL); if (item != NULL) + state = cmdq_copy_state(cmdq_get_state(item)); + else + state = cmdq_new_state(NULL, NULL, 0); + cmdq_add_format(state, "current_file", "%s", pi.file); + + new_item0 = cmdq_get_command(pr->cmdlist, state); + if (item != NULL) new_item0 = cmdq_insert_after(item, new_item0); else new_item0 = cmdq_append(NULL, new_item0); cmd_list_free(pr->cmdlist); + cmdq_free_state(state); if (new_item != NULL) *new_item = new_item0; @@ -156,6 +164,7 @@ struct cmd_parse_input pi; struct cmd_parse_result *pr; struct cmdq_item *new_item0; + struct cmdq_state *state; if (new_item != NULL) *new_item = NULL; @@ -182,12 +191,19 @@ return (0); } - new_item0 = cmdq_get_command(pr->cmdlist, NULL); if (item != NULL) + state = cmdq_copy_state(cmdq_get_state(item)); + else + state = cmdq_new_state(NULL, NULL, 0); + cmdq_add_format(state, "current_file", "%s", pi.file); + + new_item0 = cmdq_get_command(pr->cmdlist, state); + if (item != NULL) new_item0 = cmdq_insert_after(item, new_item0); else new_item0 = cmdq_append(NULL, new_item0); cmd_list_free(pr->cmdlist); + cmdq_free_state(state); if (new_item != NULL) *new_item = new_item0;