Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam 2016-03-05 10:01:09 +00:00
commit 81f78f0da7
4 changed files with 10 additions and 7 deletions

View File

@ -73,9 +73,9 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_WAIT);
}
if (c != NULL && c->session == NULL)
if (c != NULL && c->session == NULL && c->cwd != NULL)
cwd = c->cwd;
else if ((s = c->session) != NULL)
else if ((s = c->session) != NULL && s->cwd != NULL)
cwd = s->cwd;
else
cwd = ".";

View File

@ -142,7 +142,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
format_defaults(ft, c, NULL, NULL, NULL);
to_free = cwd = format_expand(ft, args_get(args, 'c'));
format_free(ft);
} else if (c != NULL && c->session == NULL)
} else if (c != NULL && c->session == NULL && c->cwd != NULL)
cwd = c->cwd;
else
cwd = ".";

View File

@ -97,9 +97,9 @@ cmd_save_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
goto do_print;
}
if (c != NULL && c->session == NULL)
if (c != NULL && c->session == NULL && c->cwd != NULL)
cwd = c->cwd;
else if ((s = c->session) != NULL)
else if ((s = c->session) != NULL && s->cwd != NULL)
cwd = s->cwd;
else
cwd = ".";

7
tmux.c
View File

@ -190,9 +190,12 @@ main(int argc, char **argv)
const char *s;
int opt, flags, keys;
setlocale(LC_CTYPE, "en_US.UTF-8");
setlocale(LC_TIME, "");
if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL)
setlocale(LC_CTYPE, "");
if (wcwidth(0xfffd) != 1)
errx(1, "no UTF-8 locale; please set LC_CTYPE");
setlocale(LC_TIME, "");
tzset();
if (**argv == '-')