diff options
author | 2012-06-18 09:20:19 +0000 | |
---|---|---|
committer | 2012-06-18 09:20:19 +0000 | |
commit | 7db0b76f3d3893e140b1d87c8d694fdddfdb7eb5 (patch) | |
tree | a2356f8df11b332f7ba87d9d5f0c3f95639ed0b2 /usr.bin/tmux/cmd.c | |
parent | Removing this 'if' statement allows dired buffers to not have their (diff) | |
download | wireguard-openbsd-7db0b76f3d3893e140b1d87c8d694fdddfdb7eb5.tar.xz wireguard-openbsd-7db0b76f3d3893e140b1d87c8d694fdddfdb7eb5.zip |
Do not crash when the current session has no window, fixes a bug
reported by Giorgio Lando. Fix from Thomas Adam.
Diffstat (limited to 'usr.bin/tmux/cmd.c')
-rw-r--r-- | usr.bin/tmux/cmd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c index 3c7c6c64a6e..d69b2f6a660 100644 --- a/usr.bin/tmux/cmd.c +++ b/usr.bin/tmux/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.65 2012/04/23 22:43:09 nicm Exp $ */ +/* $OpenBSD: cmd.c,v 1.66 2012/06/18 09:20:19 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1290,7 +1290,7 @@ cmd_get_default_path(struct cmd_ctx *ctx, const char *cwd) /* Session working directory. */ root = s->cwd; goto complete_path; - } else if (cwd[0] == '.' && (cwd[1] == '\0' || cwd[1] == '/')){ + } else if (cwd[0] == '.' && (cwd[1] == '\0' || cwd[1] == '/')) { /* Server working directory. */ if (getcwd(tmp, sizeof tmp) != NULL) { root = tmp; @@ -1304,7 +1304,7 @@ cmd_get_default_path(struct cmd_ctx *ctx, const char *cwd) /* Empty or relative path. */ if (ctx->cmdclient != NULL && ctx->cmdclient->cwd != NULL) root = ctx->cmdclient->cwd; - else if (ctx->curclient != NULL) + else if (ctx->curclient != NULL && s->curw != NULL) root = get_proc_cwd(s->curw->window->active->pid); else return (s->cwd); |