summaryrefslogtreecommitdiffstats
path: root/cmd-find.c
diff options
context:
space:
mode:
authornicm <nicm>2017-04-21 22:23:24 +0000
committernicm <nicm>2017-04-21 22:23:24 +0000
commitc8ecbf38ab09d00920e97bd9363e16a1ebed0fa7 (patch)
tree73320de7f20ff71c652ea97e7aeb4b97da215253 /cmd-find.c
parent194a121ef68d5af557e3e158d1aa6a8f013cd2ac (diff)
Log error properly when no current state, and some other minor tweaks.
Diffstat (limited to 'cmd-find.c')
-rw-r--r--cmd-find.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd-find.c b/cmd-find.c
index edd43a8b..44f50bf7 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -974,9 +974,8 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
fs->current = &current;
log_debug("%s: current is from client", __func__);
} else
- return (-1);
- if (!cmd_find_empty_state(fs->current) &&
- !cmd_find_valid_state(fs->current))
+ goto error;
+ if (!cmd_find_valid_state(fs->current))
fatalx("invalid current find state");
/* An empty or NULL target is the current. */