Make environ_set va_args and use it to tidy up some calls. Also add a

missing word in manpage (from jmc).
This commit is contained in:
nicm
2015-11-24 23:46:15 +00:00
parent 3ff46b2e43
commit 62d3af17f9
7 changed files with 48 additions and 30 deletions

View File

@@ -34,20 +34,19 @@ void server_callback_identify(int, short, void *);
void
server_fill_environ(struct session *s, struct environ *env)
{
char var[PATH_MAX], *term;
u_int idx;
long pid;
char *term;
u_int idx;
long pid;
if (s != NULL) {
term = options_get_string(global_options, "default-terminal");
environ_set(env, "TERM", term);
environ_set(env, "TERM", "%s", term);
idx = s->id;
} else
idx = (u_int)-1;
pid = getpid();
xsnprintf(var, sizeof var, "%s,%ld,%u", socket_path, pid, idx);
environ_set(env, "TMUX", var);
environ_set(env, "TMUX", "%s,%ld,%u", socket_path, pid, idx);
}
void