diff options
| author | 2018-06-08 09:43:58 +0000 | |
|---|---|---|
| committer | 2018-06-08 09:43:58 +0000 | |
| commit | 47ace6ab0debdff7cc32ddc94c06d24a34c01a9b (patch) | |
| tree | a6b50b5c49dbb89250b01607f0ed75e1627d359a /usr.bin/tmux/cmd-new-session.c | |
| parent | Add -x- and -y- to use client size, from Stefan Assmann in GitHub issue 1372. (diff) | |
| download | wireguard-openbsd-47ace6ab0debdff7cc32ddc94c06d24a34c01a9b.tar.xz wireguard-openbsd-47ace6ab0debdff7cc32ddc94c06d24a34c01a9b.zip | |
Tweak previous - check for a NULL client and simplify manual text.
Diffstat (limited to 'usr.bin/tmux/cmd-new-session.c')
| -rw-r--r-- | usr.bin/tmux/cmd-new-session.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/usr.bin/tmux/cmd-new-session.c b/usr.bin/tmux/cmd-new-session.c index 510b956ded7..8e2b6a33aec 100644 --- a/usr.bin/tmux/cmd-new-session.c +++ b/usr.bin/tmux/cmd-new-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-session.c,v 1.112 2018/06/08 09:41:34 nicm Exp $ */ +/* $OpenBSD: cmd-new-session.c,v 1.113 2018/06/08 09:43:58 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -203,9 +203,10 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) } if ((is_control || detached) && args_has(args, 'x')) { tmp = args_get(args, 'x'); - if (strcmp(tmp, "-") == 0) - sx = c->tty.sx; - else { + if (strcmp(tmp, "-") == 0) { + if (c != NULL) + sx = c->tty.sx; + } else { sx = strtonum(tmp, 1, USHRT_MAX, &errstr); if (errstr != NULL) { cmdq_error(item, "width %s", errstr); @@ -215,9 +216,10 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) } if ((is_control || detached) && args_has(args, 'y')) { tmp = args_get(args, 'y'); - if (strcmp(tmp, "-") == 0) - sy = c->tty.sy; - else { + if (strcmp(tmp, "-") == 0) { + if (c != NULL) + sy = c->tty.sy; + } else { sy = strtonum(tmp, 1, USHRT_MAX, &errstr); if (errstr != NULL) { cmdq_error(item, "height %s", errstr); |
