From 8b10d578091aa6f23392eea3c5fa3ee1e819c2e0 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 15 Jan 2018 15:27:04 +0000 Subject: Some unused code, GitHub issue 1219. --- usr.bin/tmux/cfg.c | 4 +--- usr.bin/tmux/cmd-find.c | 4 +--- usr.bin/tmux/cmd-load-buffer.c | 8 ++++---- 3 files changed, 6 insertions(+), 10 deletions(-) (limited to 'usr.bin/tmux') diff --git a/usr.bin/tmux/cfg.c b/usr.bin/tmux/cfg.c index c23bb9b5f35..c1bcfe1430e 100644 --- a/usr.bin/tmux/cfg.c +++ b/usr.bin/tmux/cfg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cfg.c,v 1.61 2017/10/06 18:02:30 nicm Exp $ */ +/* $OpenBSD: cfg.c,v 1.62 2018/01/15 15:27:03 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -287,8 +287,6 @@ load_cfg(const char *path, struct client *c, struct cmdq_item *item, int quiet) } free(buf); - if (cmdlist == NULL) - continue; new_item = cmdq_get_command(cmdlist, NULL, NULL, 0); if (item != NULL) cmdq_insert_after(item, new_item); diff --git a/usr.bin/tmux/cmd-find.c b/usr.bin/tmux/cmd-find.c index b34db99b621..b0294a5fe20 100644 --- a/usr.bin/tmux/cmd-find.c +++ b/usr.bin/tmux/cmd-find.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-find.c,v 1.57 2017/08/30 10:33:57 nicm Exp $ */ +/* $OpenBSD: cmd-find.c,v 1.58 2018/01/15 15:27:03 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -588,8 +588,6 @@ cmd_find_get_pane_with_window(struct cmd_find_state *fs, const char *pane) /* Try special characters. */ if (strcmp(pane, "!") == 0) { - if (fs->w->last == NULL) - return (-1); fs->wp = fs->w->last; if (fs->wp == NULL) return (-1); diff --git a/usr.bin/tmux/cmd-load-buffer.c b/usr.bin/tmux/cmd-load-buffer.c index eb388c71e27..9e83de8f2a6 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.50 2017/04/22 06:13:30 nicm Exp $ */ +/* $OpenBSD: cmd-load-buffer.c,v 1.51 2018/01/15 15:27:03 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -59,7 +59,8 @@ cmd_load_buffer_exec(struct cmd *self, struct cmdq_item *item) struct client *c = item->client; FILE *f; const char *path, *bufname; - char *pdata, *new_pdata, *cause, *file; + char *pdata = NULL, *new_pdata, *cause; + char *file; size_t psize; int ch, error; @@ -89,8 +90,7 @@ cmd_load_buffer_exec(struct cmd *self, struct cmdq_item *item) f = fopen(file, "rb"); if (f == NULL) { cmdq_error(item, "%s: %s", file, strerror(errno)); - free(file); - return (CMD_RETURN_ERROR); + goto error; } pdata = NULL; -- cgit v1.2.3