=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/session.c,v retrieving revision 1.56 retrieving revision 1.57 diff -c -r1.56 -r1.57 *** src/usr.bin/tmux/session.c 2015/10/27 15:58:42 1.56 --- src/usr.bin/tmux/session.c 2015/10/28 09:51:55 1.57 *************** *** 1,4 **** ! /* $OpenBSD: session.c,v 1.56 2015/10/27 15:58:42 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: session.c,v 1.57 2015/10/28 09:51:55 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 120,128 **** TAILQ_INIT(&s->lastw); RB_INIT(&s->windows); ! environ_init(&s->environ); if (env != NULL) ! environ_copy(env, &s->environ); s->options = options_create(global_s_options); s->tio = NULL; --- 120,128 ---- TAILQ_INIT(&s->lastw); RB_INIT(&s->windows); ! s->environ = environ_create(); if (env != NULL) ! environ_copy(env, s->environ); s->options = options_create(global_s_options); s->tio = NULL; *************** *** 190,196 **** log_debug("session %s freed (%d references)", s->name, s->references); if (s->references == 0) { ! environ_free(&s->environ); options_free(s->options); free(s->name); --- 190,196 ---- log_debug("session %s freed (%d references)", s->name, s->references); if (s->references == 0) { ! environ_free(s->environ); options_free(s->options); free(s->name); *************** *** 319,325 **** { struct window *w; struct winlink *wl; ! struct environ env; const char *shell; u_int hlimit; --- 319,325 ---- { struct window *w; struct winlink *wl; ! struct environ *env; const char *shell; u_int hlimit; *************** *** 328,353 **** return (NULL); } ! environ_init(&env); ! environ_copy(&global_environ, &env); ! environ_copy(&s->environ, &env); ! server_fill_environ(s, &env); shell = options_get_string(s->options, "default-shell"); if (*shell == '\0' || areshell(shell)) shell = _PATH_BSHELL; hlimit = options_get_number(s->options, "history-limit"); ! w = window_create(name, argc, argv, path, shell, cwd, &env, s->tio, s->sx, s->sy, hlimit, cause); if (w == NULL) { winlink_remove(&s->windows, wl); ! environ_free(&env); return (NULL); } winlink_set_window(wl, w); notify_window_linked(s, w); ! environ_free(&env); if (options_get_number(s->options, "set-remain-on-exit")) options_set_number(w->options, "remain-on-exit", 1); --- 328,353 ---- return (NULL); } ! env = environ_create(); ! environ_copy(global_environ, env); ! environ_copy(s->environ, env); ! server_fill_environ(s, env); shell = options_get_string(s->options, "default-shell"); if (*shell == '\0' || areshell(shell)) shell = _PATH_BSHELL; hlimit = options_get_number(s->options, "history-limit"); ! w = window_create(name, argc, argv, path, shell, cwd, env, s->tio, s->sx, s->sy, hlimit, cause); if (w == NULL) { winlink_remove(&s->windows, wl); ! environ_free(env); return (NULL); } winlink_set_window(wl, w); notify_window_linked(s, w); ! environ_free(env); if (options_get_number(s->options, "set-remain-on-exit")) options_set_number(w->options, "remain-on-exit", 1);