Sync OpenBSD patchset 168:

Both of cmdclient and curclient CAN be NULL - if the command is executed from
the configuration file. In this case, attach-session can't do much, and
new-session should just assume -d.
This commit is contained in:
Tiago Cunha
2009-07-23 13:25:27 +00:00
parent a551ff2b1b
commit f2451c1e29
3 changed files with 24 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $Id: cmd-attach-session.c,v 1.28 2009-07-18 11:06:09 nicm Exp $ */
/* $Id: cmd-attach-session.c,v 1.29 2009-07-23 13:25:27 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -55,6 +55,9 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx)
if ((s = cmd_find_session(ctx, data->target)) == NULL)
return (-1);
if (ctx->cmdclient == NULL && ctx->curclient == NULL)
return (0);
if (ctx->cmdclient == NULL) {
if (data->chflags & CMD_CHFLAG('d')) {
/*