diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2016-03-05 07:47:53 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2016-03-05 07:47:53 +0000 |
commit | 5945c7106b2f2c12b17a7a00593e354cd9ccbaab (patch) | |
tree | 638f4c60f5e076bc9313fafdb20ee88f003ed2ca /usr.bin/tmux/cmd-save-buffer.c | |
parent | 6c0bbc010703eca30a5a13d0510f5d6bb40c948c (diff) |
Do not use c->cwd or s->cwd if it is NULL, found by Ben Boeckel.
Diffstat (limited to 'usr.bin/tmux/cmd-save-buffer.c')
-rw-r--r-- | usr.bin/tmux/cmd-save-buffer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-save-buffer.c b/usr.bin/tmux/cmd-save-buffer.c index 349cdb9a18d..98cf267bf99 100644 --- a/usr.bin/tmux/cmd-save-buffer.c +++ b/usr.bin/tmux/cmd-save-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-save-buffer.c,v 1.36 2015/12/13 21:53:57 nicm Exp $ */ +/* $OpenBSD: cmd-save-buffer.c,v 1.37 2016/03/05 07:47:52 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -98,9 +98,9 @@ cmd_save_buffer_exec(struct cmd *self, struct cmd_q *cmdq) goto do_print; } - if (c != NULL && c->session == NULL) + if (c != NULL && c->session == NULL && c->cwd != NULL) cwd = c->cwd; - else if ((s = c->session) != NULL) + else if ((s = c->session) != NULL && s->cwd != NULL) cwd = s->cwd; else cwd = "."; |