diff options
author | Thomas Adam <thomas@xteddy.org> | 2014-08-09 20:31:36 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2014-08-09 20:31:36 +0100 |
commit | a131b82e95df990528371b1d9ca40ee2be264fc8 (patch) | |
tree | 156ef097c276e22b60581e3058e2661327240869 /cmd.c | |
parent | fd3b7f357200b85a6f3d6e39bae676c7c70ba082 (diff) | |
parent | 1ac96200a7462597b137719b376f40ad0cd85216 (diff) | |
download | rtmux-a131b82e95df990528371b1d9ca40ee2be264fc8.tar.gz rtmux-a131b82e95df990528371b1d9ca40ee2be264fc8.tar.bz2 rtmux-a131b82e95df990528371b1d9ca40ee2be264fc8.zip |
Merge branch 'obsd-master'
Conflicts:
client.c
Diffstat (limited to 'cmd.c')
-rw-r--r-- | cmd.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -794,8 +794,11 @@ cmd_find_session(struct cmd_q *cmdq, const char *arg, int prefer_unattached) int ambiguous; /* A NULL argument means the current session. */ - if (arg == NULL) - return (cmd_current_session(cmdq, prefer_unattached)); + if (arg == NULL) { + if ((s = cmd_current_session(cmdq, prefer_unattached)) == NULL) + cmdq_error(cmdq, "can't establish current session"); + return (s); + } /* Lookup as pane id or window id. */ if ((wp = cmd_lookup_paneid(arg)) != NULL) @@ -812,7 +815,9 @@ cmd_find_session(struct cmd_q *cmdq, const char *arg, int prefer_unattached) /* An empty session name is the current session. */ if (*tmparg == '\0') { free(tmparg); - return (cmd_current_session(cmdq, prefer_unattached)); + if ((s = cmd_current_session(cmdq, prefer_unattached)) == NULL) + cmdq_error(cmdq, "can't establish current session"); + return (s); } /* Find the session, if any. */ |