version 1.45, 2015/10/28 09:51:55 |
version 1.46, 2015/10/31 08:13:58 |
|
|
struct window_pane *wp = NULL; |
struct window_pane *wp = NULL; |
const char *update; |
const char *update; |
char *cause; |
char *cause; |
int fd; |
|
struct format_tree *ft; |
struct format_tree *ft; |
char *cp; |
char *cwd; |
|
|
if (RB_EMPTY(&sessions)) { |
if (RB_EMPTY(&sessions)) { |
cmdq_error(cmdq, "no sessions"); |
cmdq_error(cmdq, "no sessions"); |
|
|
ft = format_create(); |
ft = format_create(); |
format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, |
format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, |
NULL, NULL); |
NULL, NULL); |
cp = format_expand(ft, cflag); |
cwd = format_expand(ft, cflag); |
format_free(ft); |
format_free(ft); |
|
|
fd = open(cp, O_RDONLY|O_DIRECTORY); |
if (access(cwd, X_OK) != 0) { |
free(cp); |
free((void *)cwd); |
if (fd == -1) { |
|
cmdq_error(cmdq, "bad working directory: %s", |
cmdq_error(cmdq, "bad working directory: %s", |
strerror(errno)); |
strerror(errno)); |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
} |
} |
close(s->cwd); |
free((void *)s->cwd); |
s->cwd = fd; |
s->cwd = cwd; |
} |
} |
|
|
if (c->session != NULL) { |
if (c->session != NULL) { |