=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-new-session.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- src/usr.bin/tmux/cmd-new-session.c 2013/03/25 11:44:00 1.50 +++ src/usr.bin/tmux/cmd-new-session.c 2013/10/10 12:00:21 1.51 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-session.c,v 1.50 2013/03/25 11:44:00 nicm Exp $ */ +/* $OpenBSD: cmd-new-session.c,v 1.51 2013/10/10 12:00:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -30,7 +30,6 @@ * Create a new session and attach to the current terminal unless -d is given. */ -enum cmd_retval cmd_new_session_check(struct args *); enum cmd_retval cmd_new_session_exec(struct cmd *, struct cmd_q *); const struct cmd_entry cmd_new_session_entry = { @@ -40,19 +39,10 @@ CMD_TARGET_SESSION_USAGE " [-x width] [-y height] [command]", CMD_STARTSERVER|CMD_CANTNEST|CMD_SENDENVIRON, NULL, - cmd_new_session_check, cmd_new_session_exec }; enum cmd_retval -cmd_new_session_check(struct args *args) -{ - if (args_has(args, 't') && (args->argc != 0 || args_has(args, 'n'))) - return (CMD_RETURN_ERROR); - return (CMD_RETURN_NORMAL); -} - -enum cmd_retval cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq) { struct args *args = self->args; @@ -69,6 +59,11 @@ u_int sx, sy; int already_attached; struct format_tree *ft; + + if (args_has(args, 't') && (args->argc != 0 || args_has(args, 'n'))) { + cmdq_error(cmdq, "command or window name given with target"); + return (CMD_RETURN_ERROR); + } newname = args_get(args, 's'); if (newname != NULL) {