summaryrefslogtreecommitdiffstats
path: root/cmd-split-window.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2010-07-02 02:49:19 +0000
committerTiago Cunha <tcunha@gmx.com>2010-07-02 02:49:19 +0000
commit63e76b555d8f3d40f9905fb65a58f6e7509d399d (patch)
treeb9b003f298a235899b3d7aa03014d0f27bff13cd /cmd-split-window.c
parent13e7f060b1819ecdb1fcf88eee56293aa8b9f4cf (diff)
Sync OpenBSD patchset 730:
Store the current working directory in the session, change the default-path option to default to empty and make that mean that the stored session CWD is used.
Diffstat (limited to 'cmd-split-window.c')
-rw-r--r--cmd-split-window.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/cmd-split-window.c b/cmd-split-window.c
index e39e5152..dbfe628e 100644
--- a/cmd-split-window.c
+++ b/cmd-split-window.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-split-window.c,v 1.34 2010-01-08 16:31:35 tcunha Exp $ */
+/* $Id: cmd-split-window.c,v 1.35 2010-07-02 02:49:19 tcunha Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -169,10 +169,13 @@ cmd_split_window_exec(struct cmd *self, struct cmd_ctx *ctx)
cmd = data->cmd;
if (cmd == NULL)
cmd = options_get_string(&s->options, "default-command");
- if (ctx->cmdclient == NULL || ctx->cmdclient->cwd == NULL)
- cwd = options_get_string(&s->options, "default-path");
- else
- cwd = ctx->cmdclient->cwd;
+ cwd = options_get_string(&s->options, "default-path");
+ if (*cwd == '\0') {
+ if (ctx->cmdclient != NULL && ctx->cmdclient->cwd != NULL)
+ cwd = ctx->cmdclient->cwd;
+ else
+ cwd = s->cwd;
+ }
type = LAYOUT_TOPBOTTOM;
if (data->flag_horizontal)