From 4d2033988b58e8d9ef2c8799237460d88bace6f7 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 14 Jun 2017 07:37:17 +0000 Subject: [PATCH] Add missing error message when no target, GitHub issue 971. --- usr.bin/tmux/cmd-find.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.bin/tmux/cmd-find.c b/usr.bin/tmux/cmd-find.c index 5407cce75e9..41a6e921ada 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.52 2017/04/22 12:08:41 nicm Exp $ */ +/* $OpenBSD: cmd-find.c,v 1.53 2017/06/14 07:37:17 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -977,8 +977,11 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item, } else if (cmd_find_from_client(¤t, item->client) == 0) { fs->current = ¤t; log_debug("%s: current is from client", __func__); - } else + } else { + if (~flags & CMD_FIND_QUIET) + cmdq_error(item, "no current target"); goto error; + } if (!cmd_find_valid_state(fs->current)) fatalx("invalid current find state"); -- 2.20.1