diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-08-20 18:59:54 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-08-20 18:59:54 +0000 |
commit | c8b4b5f08ad924172f819d4e05271006e6447746 (patch) | |
tree | 4ce088a611f538a498f30175003784ce200fa995 /usr.bin/tmux/cmd-new-session.c | |
parent | 7945ba1cb9346b88267a4022df6945ee52e11e44 (diff) |
Expose args_value struct (will be needed soon) and add some missing frees.
Diffstat (limited to 'usr.bin/tmux/cmd-new-session.c')
-rw-r--r-- | usr.bin/tmux/cmd-new-session.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/tmux/cmd-new-session.c b/usr.bin/tmux/cmd-new-session.c index fbcd907dff0..c35c00b0c09 100644 --- a/usr.bin/tmux/cmd-new-session.c +++ b/usr.bin/tmux/cmd-new-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-session.c,v 1.139 2021/08/13 06:52:51 nicm Exp $ */ +/* $OpenBSD: cmd-new-session.c,v 1.140 2021/08/20 18:59:53 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -75,7 +75,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) struct options *oo; struct termios tio, *tiop; struct session_group *sg = NULL; - const char *errstr, *template, *group, *tmp, *add; + const char *errstr, *template, *group, *tmp; char *cause, *cwd = NULL, *cp, *newname = NULL; char *name, *prefix = NULL; int detached, already_attached, is_control = 0; @@ -83,7 +83,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) struct spawn_context sc; enum cmd_retval retval; struct cmd_find_state fs; - struct args_value *value; + struct args_value *av; if (cmd_get_entry(self) == &cmd_has_session_entry) { /* @@ -269,10 +269,10 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) env = environ_create(); if (c != NULL && !args_has(args, 'E')) environ_update(global_s_options, c->environ, env); - add = args_first_value(args, 'e', &value); - while (add != NULL) { - environ_put(env, add, 0); - add = args_next_value(&value); + av = args_first_value(args, 'e'); + while (av != NULL) { + environ_put(env, av->value, 0); + av = args_next_value(av); } s = session_create(prefix, newname, cwd, env, oo, tiop); |