mirror of
https://github.com/tmux/tmux.git
synced 2025-01-27 16:48:49 +00:00
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.
This commit is contained in:
parent
17bc11bd15
commit
e252984993
@ -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);
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <pwd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -202,7 +202,7 @@ cmdq_get_command(struct cmd_list *cmdlist, struct cmd_find_state *current,
|
||||
{
|
||||
struct cmdq_item *item, *first = NULL, *last = NULL;
|
||||
struct cmd *cmd;
|
||||
struct cmdq_shared *shared;
|
||||
struct cmdq_shared *shared = NULL;
|
||||
u_int group = 0;
|
||||
|
||||
TAILQ_FOREACH(cmd, &cmdlist->list, qentry) {
|
||||
|
4
format.c
4
format.c
@ -1518,7 +1518,7 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen,
|
||||
char **buf, size_t *len, size_t *off)
|
||||
{
|
||||
struct window_pane *wp = ft->wp;
|
||||
const char *errptr, *copy, *cp, *marker;
|
||||
const char *errptr, *copy, *cp, *marker = NULL;
|
||||
char *copy0, *condition, *found, *new;
|
||||
char *value, *left, *right;
|
||||
size_t valuelen;
|
||||
@ -1566,8 +1566,6 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen,
|
||||
limit = 0;
|
||||
if (fm->argc == 2 && fm->argv[1] != NULL)
|
||||
marker = fm->argv[1];
|
||||
else
|
||||
marker = NULL;
|
||||
break;
|
||||
case 'l':
|
||||
modifiers |= FORMAT_LITERAL;
|
||||
|
Loading…
Reference in New Issue
Block a user