From 1dc92abfa82300cdc0a8955597117a44303c1663 Mon Sep 17 00:00:00 2001 From: Sander van Dijk Date: Tue, 4 Jul 2006 20:50:15 +0000 Subject: [PATCH] small fix (off-by-one), small change --- cmd/wmiimenu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/wmiimenu.c b/cmd/wmiimenu.c index c561fc6c..9e08d674 100644 --- a/cmd/wmiimenu.c +++ b/cmd/wmiimenu.c @@ -109,7 +109,7 @@ update_items(char *pattern) for(i = allitem; i; i=i->next) if(!plen || !strncmp(pattern, i->text, plen)) { - if(!item) + if(!j) item = i; else j->right = i; @@ -121,7 +121,7 @@ update_items(char *pattern) for(i = allitem; i; i=i->next) if(plen && strncmp(pattern, i->text, plen) && strstr(i->text, pattern)) { - if(!item) + if(!j) item = i; else j->right = i; @@ -198,7 +198,7 @@ draw_menu() brush.border = False; brush.rect.x = mrect.width - seek; brush.rect.width = seek; - blitz_draw_label(&brush, (nextoff && nextoff->right) ? ">" : nil); + blitz_draw_label(&brush, nextoff ? ">" : nil); } XCopyArea(blz.dpy, brush.drawable, win, brush.gc, 0, 0, mrect.width, mrect.height, 0, 0); @@ -316,7 +316,7 @@ handle_kpress(XKeyEvent * e) if(curroff && sel == curroff->left) { curroff = prevoff; update_offsets(); - } else if(sel == nextoff && nextoff->right) { + } else if(sel == nextoff) { curroff = nextoff; update_offsets(); }