summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-10-31 14:51:16 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-10-31 14:51:16 +0000
commit394736931b2b2686fe932cda0157e8adf1363365 (patch)
tree4b1e1c13804852cbca6ef641bf97cf0061b18766
parent0c2f3fa14b7dba1601821d1e7d9bab203a1b40bd (diff)
Fall back silently to ~ or / rather than checking -c with access(), this
was the old behaviour.
-rw-r--r--usr.bin/tmux/cmd-attach-session.c8
-rw-r--r--usr.bin/tmux/cmd-new-session.c9
-rw-r--r--usr.bin/tmux/cmd-new-window.c9
-rw-r--r--usr.bin/tmux/cmd-split-window.c9
4 files changed, 4 insertions, 31 deletions
diff --git a/usr.bin/tmux/cmd-attach-session.c b/usr.bin/tmux/cmd-attach-session.c
index 093c2b7e649..3aca8fcb45c 100644
--- a/usr.bin/tmux/cmd-attach-session.c
+++ b/usr.bin/tmux/cmd-attach-session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-attach-session.c,v 1.46 2015/10/31 08:13:58 nicm Exp $ */
+/* $OpenBSD: cmd-attach-session.c,v 1.47 2015/10/31 14:51:15 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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/usr.bin/tmux/cmd-new-session.c b/usr.bin/tmux/cmd-new-session.c
index 6ca91bd404e..563a536f5dc 100644
--- a/usr.bin/tmux/cmd-new-session.c
+++ b/usr.bin/tmux/cmd-new-session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-new-session.c,v 1.76 2015/10/31 08:13:58 nicm Exp $ */
+/* $OpenBSD: cmd-new-session.c,v 1.77 2015/10/31 14:51:15 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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/usr.bin/tmux/cmd-new-window.c b/usr.bin/tmux/cmd-new-window.c
index 5762ba95473..8a4475193d5 100644
--- a/usr.bin/tmux/cmd-new-window.c
+++ b/usr.bin/tmux/cmd-new-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-new-window.c,v 1.50 2015/10/31 08:13:58 nicm Exp $ */
+/* $OpenBSD: cmd-new-window.c,v 1.51 2015/10/31 14:51:15 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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/usr.bin/tmux/cmd-split-window.c b/usr.bin/tmux/cmd-split-window.c
index 074e8dbefa3..6acfb87b2b6 100644
--- a/usr.bin/tmux/cmd-split-window.c
+++ b/usr.bin/tmux/cmd-split-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-split-window.c,v 1.61 2015/10/31 08:13:58 nicm Exp $ */
+/* $OpenBSD: cmd-split-window.c,v 1.62 2015/10/31 14:51:15 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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