summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/tmux/cmd-command-prompt.c4
-rw-r--r--usr.bin/tmux/cmd-load-buffer.c4
-rw-r--r--usr.bin/tmux/cmd-save-buffer.c4
-rw-r--r--usr.bin/tmux/cmd-switch-client.c4
4 files changed, 7 insertions, 9 deletions
diff --git a/usr.bin/tmux/cmd-command-prompt.c b/usr.bin/tmux/cmd-command-prompt.c
index b768ed59721..9235f8b107d 100644
--- a/usr.bin/tmux/cmd-command-prompt.c
+++ b/usr.bin/tmux/cmd-command-prompt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-command-prompt.c,v 1.39 2017/01/06 11:57:03 nicm Exp $ */
+/* $OpenBSD: cmd-command-prompt.c,v 1.40 2017/01/06 13:26:09 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -72,7 +72,6 @@ cmd_command_prompt_exec(struct cmd *self, struct cmdq_item *item)
struct client *c = item->state.c;
char *prompt, *ptr, *input = NULL;
size_t n;
- int flags;
if (c->prompt_string != NULL)
return (CMD_RETURN_NORMAL);
@@ -117,7 +116,6 @@ cmd_command_prompt_exec(struct cmd *self, struct cmdq_item *item)
input = strsep(&cdata->next_input, ",");
}
- flags = 0;
if (args_has(args, '1'))
cdata->flags |= PROMPT_SINGLE;
else if (args_has(args, 'N'))
diff --git a/usr.bin/tmux/cmd-load-buffer.c b/usr.bin/tmux/cmd-load-buffer.c
index a7ea1cc2531..639bfaa7248 100644
--- a/usr.bin/tmux/cmd-load-buffer.c
+++ b/usr.bin/tmux/cmd-load-buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-load-buffer.c,v 1.47 2016/10/26 11:48:07 nicm Exp $ */
+/* $OpenBSD: cmd-load-buffer.c,v 1.48 2017/01/06 13:26:09 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -89,7 +89,7 @@ cmd_load_buffer_exec(struct cmd *self, struct cmdq_item *item)
if (c != NULL && c->session == NULL && c->cwd != NULL)
cwd = c->cwd;
- else if ((s = c->session) != NULL && s->cwd != NULL)
+ else if (c != NULL && (s = c->session) != NULL && s->cwd != NULL)
cwd = s->cwd;
else
cwd = ".";
diff --git a/usr.bin/tmux/cmd-save-buffer.c b/usr.bin/tmux/cmd-save-buffer.c
index 13928c969c9..640e1a41a1f 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.40 2016/10/16 19:04:05 nicm Exp $ */
+/* $OpenBSD: cmd-save-buffer.c,v 1.41 2017/01/06 13:26:09 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -100,7 +100,7 @@ cmd_save_buffer_exec(struct cmd *self, struct cmdq_item *item)
if (c != NULL && c->session == NULL && c->cwd != NULL)
cwd = c->cwd;
- else if ((s = c->session) != NULL && s->cwd != NULL)
+ else if (c != NULL && (s = c->session) != NULL && s->cwd != NULL)
cwd = s->cwd;
else
cwd = ".";
diff --git a/usr.bin/tmux/cmd-switch-client.c b/usr.bin/tmux/cmd-switch-client.c
index 2b8f3549453..b4680165bef 100644
--- a/usr.bin/tmux/cmd-switch-client.c
+++ b/usr.bin/tmux/cmd-switch-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-switch-client.c,v 1.44 2016/10/16 19:04:05 nicm Exp $ */
+/* $OpenBSD: cmd-switch-client.c,v 1.45 2017/01/06 13:26:09 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -102,7 +102,7 @@ cmd_switch_client_exec(struct cmd *self, struct cmdq_item *item)
}
}
- if (c != NULL && !args_has(args, 'E')) {
+ if (!args_has(args, 'E')) {
update = options_get_string(s->options, "update-environment");
environ_update(update, c->environ, s->environ);
}