diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2019-06-05 06:44:08 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2019-06-05 06:44:08 +0100 |
commit | e252984993fdfd57a1fdc1eaf393e42e8589d623 (patch) | |
tree | 0f4f7beda1288b2990d0fd6691985e120411c2a2 /cmd-new-session.c | |
parent | 17bc11bd157db83fd90051824c289712fbac7eae (diff) | |
download | rtmux-e252984993fdfd57a1fdc1eaf393e42e8589d623.tar.gz rtmux-e252984993fdfd57a1fdc1eaf393e42e8589d623.tar.bz2 rtmux-e252984993fdfd57a1fdc1eaf393e42e8589d623.zip |
If only one of -x or -y is given, use the calculated size for the
other. Also fix some warnings. Pointed out by Ben Boeckel.
Diffstat (limited to 'cmd-new-session.c')
-rw-r--r-- | cmd-new-session.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c index 2fd13420..559c268c 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -242,8 +242,13 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) /* Create the new session. */ oo = options_create(global_s_options); - if (args_has(args, 'x') || args_has(args, 'y')) + if (args_has(args, 'x') || args_has(args, 'y')) { + if (!args_has(args, 'x')) + dsx = sx; + if (!args_has(args, 'y')) + dsy = sy; options_set_string(oo, "default-size", 0, "%ux%u", dsx, dsy); + } env = environ_create(); if (c != NULL && !args_has(args, 'E')) environ_update(global_s_options, c->environ, env); |