aboutsummaryrefslogtreecommitdiff
path: root/cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd.c b/cmd.c
index f3326df2..0d6a85ff 100644
--- a/cmd.c
+++ b/cmd.c
@@ -326,9 +326,9 @@ cmd_current_session(struct cmd_q *cmdq, int prefer_unattached)
return (c->session);
/*
- * If the name of the calling client's pty is know, build a list of the
- * sessions that contain it and if any choose either the first or the
- * newest.
+ * If the name of the calling client's pty is known, build a list of
+ * the sessions that contain it and if any choose either the first or
+ * the newest.
*/
path = c == NULL ? NULL : c->tty.path;
if (path != NULL) {
@@ -531,7 +531,7 @@ cmd_lookup_client(const char *name)
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
c = ARRAY_ITEM(&clients, i);
- if (c == NULL || c->session == NULL)
+ if (c == NULL || c->session == NULL || c->tty.path == NULL)
continue;
path = c->tty.path;