diff options
author | 2016-03-05 07:47:52 +0000 | |
---|---|---|
committer | 2016-03-05 07:47:52 +0000 | |
commit | b0cf51d774f363ec79dd554442667acbad1a3184 (patch) | |
tree | bed397ac601db296bbef57e65935f76c53e107a5 /usr.bin/tmux/cmd-save-buffer.c | |
parent | KNF: wrap three overly long lines. No binary change. (diff) | |
download | wireguard-openbsd-b0cf51d774f363ec79dd554442667acbad1a3184.tar.xz wireguard-openbsd-b0cf51d774f363ec79dd554442667acbad1a3184.zip |
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 = "."; |