summaryrefslogtreecommitdiffstats
path: root/cmd-attach-session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-07-23 12:33:48 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-07-23 12:33:48 +0000
commit96a7cf1e6a133979eca4d1a8bf0e3bc3887a886d (patch)
tree933d922adf8575d75ff592501a8dc25730ecf76a /cmd-attach-session.c
parent05b511f96aeede18a6cc9b7e1e1edb4bb4f70dd7 (diff)
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.
Diffstat (limited to 'cmd-attach-session.c')
-rw-r--r--cmd-attach-session.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd-attach-session.c b/cmd-attach-session.c
index aae8abe7..2d930560 100644
--- a/cmd-attach-session.c
+++ b/cmd-attach-session.c
@@ -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')) {
/*