aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorarg@mig29 <unknown>2006-12-14 09:30:23 +0100
committerarg@mig29 <unknown>2006-12-14 09:30:23 +0100
commit225cd764c321b3c33f6da892a7599e4e8d86ab85 (patch)
tree4a387dc9538894fbbe9e2dbaf84556f3c528909a /main.c
parent279966a16f32c60f698bf70161c243c4cd1f1c5e (diff)
downloaddmenu-225cd764c321b3c33f6da892a7599e4e8d86ab85.tar.gz
dmenu-225cd764c321b3c33f6da892a7599e4e8d86ab85.tar.bz2
dmenu-225cd764c321b3c33f6da892a7599e4e8d86ab85.zip
applied hotfix of sander
Diffstat (limited to 'main.c')
-rw-r--r--main.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/main.c b/main.c
index 964fad6..3ea9d89 100644
--- a/main.c
+++ b/main.c
@@ -200,11 +200,13 @@ kpress(XKeyEvent * e) {
}
break;
case XK_End:
+ if(!sel)
+ return;
while(next) {
sel = curr = next;
calcoffsets();
}
- while(sel->right)
+ while(sel && sel->right)
sel = sel->right;
break;
case XK_Escape:
@@ -212,6 +214,8 @@ kpress(XKeyEvent * e) {
running = False;
break;
case XK_Home:
+ if(!item)
+ return;
sel = curr = item;
calcoffsets();
break;
@@ -225,16 +229,16 @@ kpress(XKeyEvent * e) {
}
break;
case XK_Next:
- if(next) {
- sel = curr = next;
- calcoffsets();
- }
+ if(!next)
+ return;
+ sel = curr = next;
+ calcoffsets();
break;
case XK_Prior:
- if(prev) {
- sel = curr = prev;
- calcoffsets();
- }
+ if(!prev)
+ return;
+ sel = curr = prev;
+ calcoffsets();
break;
case XK_Return:
if((e->state & ShiftMask) && text)