summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-find.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-06-14 07:37:18 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-06-14 07:37:18 +0000
commit21f6bec8eb5b7db9e2ad1365a3710672c3614f1c (patch)
treeb9d97a8cf5f92773068ae58fc02cb6b60a895fd7 /usr.bin/tmux/cmd-find.c
parentfe6a87c8fb7d5ce5eca5acc11c5bb47f8478075b (diff)
Add missing error message when no target, GitHub issue 971.
Diffstat (limited to 'usr.bin/tmux/cmd-find.c')
-rw-r--r--usr.bin/tmux/cmd-find.c7
1 files 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 <nicholas.marriott@gmail.com>
@@ -977,8 +977,11 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
} else if (cmd_find_from_client(&current, item->client) == 0) {
fs->current = &current;
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");