From ba7fb49fb9b972a03547381783abe91be3fcfa37 Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 31 Oct 2015 14:51:15 +0000 Subject: [PATCH] Fall back silently to ~ or / rather than checking -c with access(), this was the old behaviour. --- cmd-attach-session.c | 6 ------ cmd-new-session.c | 7 ------- cmd-new-window.c | 7 ------- cmd-split-window.c | 7 ------- 4 files changed, 27 deletions(-) diff --git a/cmd-attach-session.c b/cmd-attach-session.c index b339b890..e5589277 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -99,12 +99,6 @@ cmd_attach_session(struct cmd_q *cmdq, const char *tflag, int dflag, int rflag, cwd = format_expand(ft, cflag); 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); s->cwd = cwd; } diff --git a/cmd-new-session.c b/cmd-new-session.c index 90bb2e0e..65dc6cf5 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -124,13 +124,6 @@ cmd_new_session_exec(struct cmd *self, struct cmd_q *cmdq) NULL); to_free = cwd = format_expand(ft, args_get(args, 'c')); 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) cwd = c->cwd; else if ((c0 = cmd_find_client(cmdq, NULL, 1)) != NULL) diff --git a/cmd-new-window.c b/cmd-new-window.c index a5085fff..fb89e24f 100644 --- a/cmd-new-window.c +++ b/cmd-new-window.c @@ -99,13 +99,6 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq) NULL); cwd = format_expand(ft, args_get(args, 'c')); 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) cwd = cmdq->client->cwd; else diff --git a/cmd-split-window.c b/cmd-split-window.c index 6adb19a8..fb766d3b 100644 --- a/cmd-split-window.c +++ b/cmd-split-window.c @@ -93,13 +93,6 @@ cmd_split_window_exec(struct cmd *self, struct cmd_q *cmdq) NULL); to_free = cwd = format_expand(ft, args_get(args, 'c')); 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) cwd = cmdq->client->cwd; else