From f2451c1e29d60b505855d7b0ca2077e2ae3e1dc8 Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Thu, 23 Jul 2009 13:25:27 +0000 Subject: 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. --- cmd-attach-session.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmd-attach-session.c') diff --git a/cmd-attach-session.c b/cmd-attach-session.c index 1a0ee68d..410c7062 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -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 @@ -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')) { /* -- cgit