summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2017-04-25 12:08:06 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2017-04-25 12:08:06 +0000
commitded347675c5f12f9c05433243ab8cd8ed513cff2 (patch)
tree78e874f3c37b379541b2a77e389ef9dd89214a03 /app
parent1177b31eece212cff641a78b080db6b9bb6d403c (diff)
Remove 'noresult' (and simplify) as it does nothing and makes the logic around
it needless. History doesn't show what this might have been used for in future iterations.
Diffstat (limited to 'app')
-rw-r--r--app/cwm/menu.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/app/cwm/menu.c b/app/cwm/menu.c
index b3b7e57a1..0e0eaf8e7 100644
--- a/app/cwm/menu.c
+++ b/app/cwm/menu.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: menu.c,v 1.101 2016/12/06 21:59:33 okan Exp $
+ * $OpenBSD: menu.c,v 1.102 2017/04/25 12:08:05 okan Exp $
*/
#include <sys/types.h>
@@ -52,7 +52,6 @@ struct menu_ctx {
int list;
int listing;
int changed;
- int noresult;
int prev;
int entry;
int num;
@@ -313,15 +312,10 @@ menu_handle_key(XEvent *e, struct menu_ctx *mc, struct menu_q *menuq,
(void)strlcat(mc->searchstr, chr, sizeof(mc->searchstr));
}
- mc->noresult = 0;
- if (mc->changed && mc->searchstr[0] != '\0') {
- (*mc->match)(menuq, resultq, mc->searchstr);
- /* If menuq is empty, never show we've failed */
- mc->noresult = TAILQ_EMPTY(resultq) && !TAILQ_EMPTY(menuq);
- } else if (mc->changed)
- TAILQ_INIT(resultq);
-
- if (!mc->list && mc->listing && !mc->changed) {
+ if (mc->changed) {
+ if (mc->searchstr[0] != '\0')
+ (*mc->match)(menuq, resultq, mc->searchstr);
+ } else if (!mc->list && mc->listing) {
TAILQ_INIT(resultq);
mc->listing = 0;
}