diff options
Diffstat (limited to 'usr.bin/tmux/window.c')
-rw-r--r-- | usr.bin/tmux/window.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index 1987d6e75eb..47f705a43a0 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.46 2010/04/04 18:48:37 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.47 2010/04/04 19:02:09 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -480,14 +480,11 @@ int window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell, const char *cwd, struct environ *env, struct termios *tio, char **cause) { - struct winsize ws; - int mode; - char *argv0, **varp, *var; - ARRAY_DECL(, char *) varlist; - struct environ_entry *envent; - const char *ptr; - struct termios tio2; - u_int i; + struct winsize ws; + int mode; + char *argv0; + const char *ptr; + struct termios tio2; if (wp->fd != -1) { close(wp->fd); @@ -530,20 +527,7 @@ window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell, if (tcsetattr(STDIN_FILENO, TCSANOW, &tio2) != 0) fatal("tcgetattr failed"); - ARRAY_INIT(&varlist); - for (varp = environ; *varp != NULL; varp++) { - var = xstrdup(*varp); - var[strcspn(var, "=")] = '\0'; - ARRAY_ADD(&varlist, var); - } - for (i = 0; i < ARRAY_LENGTH(&varlist); i++) { - var = ARRAY_ITEM(&varlist, i); - unsetenv(var); - } - RB_FOREACH(envent, environ, env) { - if (envent->value != NULL) - setenv(envent->name, envent->value, 1); - } + environ_push(env); server_signal_clear(); log_close(); |