=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/session.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- src/usr.bin/tmux/session.c 2014/04/17 13:02:59 1.43 +++ src/usr.bin/tmux/session.c 2014/05/13 08:08:32 1.44 @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.43 2014/04/17 13:02:59 nicm Exp $ */ +/* $OpenBSD: session.c,v 1.44 2014/05/13 08:08:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -85,11 +85,12 @@ /* Create a new session. */ struct session * -session_create(const char *name, const char *cmd, const char *path, int cwd, - struct environ *env, struct termios *tio, int idx, u_int sx, u_int sy, - char **cause) +session_create(const char *name, int argc, char **argv, const char *path, + int cwd, struct environ *env, struct termios *tio, int idx, u_int sx, + u_int sy, char **cause) { struct session *s; + struct winlink *wl; s = xmalloc(sizeof *s); s->references = 0; @@ -132,8 +133,9 @@ } RB_INSERT(sessions, &sessions, s); - if (cmd != NULL) { - if (session_new(s, NULL, cmd, path, cwd, idx, cause) == NULL) { + if (argc >= 0) { + wl = session_new(s, NULL, argc, argv, path, cwd, idx, cause); + if (wl == NULL) { session_destroy(s); return (NULL); } @@ -227,7 +229,7 @@ /* Create a new window on a session. */ struct winlink * -session_new(struct session *s, const char *name, const char *cmd, +session_new(struct session *s, const char *name, int argc, char **argv, const char *path, int cwd, int idx, char **cause) { struct window *w; @@ -251,8 +253,8 @@ shell = _PATH_BSHELL; hlimit = options_get_number(&s->options, "history-limit"); - w = window_create(name, cmd, path, shell, cwd, &env, s->tio, s->sx, - s->sy, hlimit, cause); + 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);