diff options
Diffstat (limited to 'cmd-new-window.c')
-rw-r--r-- | cmd-new-window.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/cmd-new-window.c b/cmd-new-window.c index 85680433..9a412de2 100644 --- a/cmd-new-window.c +++ b/cmd-new-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-new-window.c,v 1.46 2010-06-22 23:26:18 tcunha Exp $ */ +/* $Id: cmd-new-window.c,v 1.47 2010-07-02 02:49:19 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -176,10 +176,13 @@ cmd_new_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; + } if (idx == -1) idx = -1 - options_get_number(&s->options, "base-index"); |