mirror of
https://github.com/tmux/tmux.git
synced 2025-04-11 11:46:13 +00:00
Fall back silently to ~ or / rather than checking -c with access(), this
was the old behaviour.
This commit is contained in:
parent
b0a99e85b6
commit
ba7fb49fb9
@ -99,12 +99,6 @@ cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int rflag,
|
|||||||
cwd = format_expand(ft, cflag);
|
cwd = format_expand(ft, cflag);
|
||||||
format_free(ft);
|
format_free(ft);
|
||||||
|
|
||||||
if (access(cwd, X_OK) != 0) {
|
|
||||||
free((void *)cwd);
|
|
||||||
cmdq_error(cmdq, "bad working directory: %s",
|
|
||||||
strerror(errno));
|
|
||||||
return (CMD_RETURN_ERROR);
|
|
||||||
}
|
|
||||||
free((void *)s->cwd);
|
free((void *)s->cwd);
|
||||||
s->cwd = cwd;
|
s->cwd = cwd;
|
||||||
}
|
}
|
||||||
|
@ -124,13 +124,6 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
NULL);
|
NULL);
|
||||||
to_free = cwd = format_expand(ft, args_get(args, 'c'));
|
to_free = cwd = format_expand(ft, args_get(args, 'c'));
|
||||||
format_free(ft);
|
format_free(ft);
|
||||||
|
|
||||||
if (access(cwd, X_OK) != 0) {
|
|
||||||
free((void *)cwd);
|
|
||||||
cmdq_error(cmdq, "bad working directory: %s",
|
|
||||||
strerror(errno));
|
|
||||||
return (CMD_RETURN_ERROR);
|
|
||||||
}
|
|
||||||
} else if (c != NULL && c->session == NULL)
|
} else if (c != NULL && c->session == NULL)
|
||||||
cwd = c->cwd;
|
cwd = c->cwd;
|
||||||
else if ((c0 = cmd_find_client(cmdq, NULL, 1)) != NULL)
|
else if ((c0 = cmd_find_client(cmdq, NULL, 1)) != NULL)
|
||||||
|
@ -99,13 +99,6 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
NULL);
|
NULL);
|
||||||
cwd = format_expand(ft, args_get(args, 'c'));
|
cwd = format_expand(ft, args_get(args, 'c'));
|
||||||
format_free(ft);
|
format_free(ft);
|
||||||
|
|
||||||
if (access(cwd, X_OK) != 0) {
|
|
||||||
free((void *)cwd);
|
|
||||||
cmdq_error(cmdq, "bad working directory: %s",
|
|
||||||
strerror(errno));
|
|
||||||
return (CMD_RETURN_ERROR);
|
|
||||||
}
|
|
||||||
} else if (cmdq->client != NULL && cmdq->client->session == NULL)
|
} else if (cmdq->client != NULL && cmdq->client->session == NULL)
|
||||||
cwd = cmdq->client->cwd;
|
cwd = cmdq->client->cwd;
|
||||||
else
|
else
|
||||||
|
@ -93,13 +93,6 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
NULL);
|
NULL);
|
||||||
to_free = cwd = format_expand(ft, args_get(args, 'c'));
|
to_free = cwd = format_expand(ft, args_get(args, 'c'));
|
||||||
format_free(ft);
|
format_free(ft);
|
||||||
|
|
||||||
if (access(cwd, X_OK) != 0) {
|
|
||||||
free((void *)cwd);
|
|
||||||
cmdq_error(cmdq, "bad working directory: %s",
|
|
||||||
strerror(errno));
|
|
||||||
return (CMD_RETURN_ERROR);
|
|
||||||
}
|
|
||||||
} else if (cmdq->client != NULL && cmdq->client->session == NULL)
|
} else if (cmdq->client != NULL && cmdq->client->session == NULL)
|
||||||
cwd = cmdq->client->cwd;
|
cwd = cmdq->client->cwd;
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user