small fix (off-by-one), small change

This commit is contained in:
Sander van Dijk 2006-07-04 20:50:15 +00:00
parent 35e90254c1
commit 1dc92abfa8

View File

@ -109,7 +109,7 @@ update_items(char *pattern)
for(i = allitem; i; i=i->next) for(i = allitem; i; i=i->next)
if(!plen || !strncmp(pattern, i->text, plen)) { if(!plen || !strncmp(pattern, i->text, plen)) {
if(!item) if(!j)
item = i; item = i;
else else
j->right = i; j->right = i;
@ -121,7 +121,7 @@ update_items(char *pattern)
for(i = allitem; i; i=i->next) for(i = allitem; i; i=i->next)
if(plen && strncmp(pattern, i->text, plen) if(plen && strncmp(pattern, i->text, plen)
&& strstr(i->text, pattern)) { && strstr(i->text, pattern)) {
if(!item) if(!j)
item = i; item = i;
else else
j->right = i; j->right = i;
@ -198,7 +198,7 @@ draw_menu()
brush.border = False; brush.border = False;
brush.rect.x = mrect.width - seek; brush.rect.x = mrect.width - seek;
brush.rect.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, XCopyArea(blz.dpy, brush.drawable, win, brush.gc, 0, 0, mrect.width,
mrect.height, 0, 0); mrect.height, 0, 0);
@ -316,7 +316,7 @@ handle_kpress(XKeyEvent * e)
if(curroff && sel == curroff->left) { if(curroff && sel == curroff->left) {
curroff = prevoff; curroff = prevoff;
update_offsets(); update_offsets();
} else if(sel == nextoff && nextoff->right) { } else if(sel == nextoff) {
curroff = nextoff; curroff = nextoff;
update_offsets(); update_offsets();
} }