aboutsummaryrefslogtreecommitdiff
path: root/dmenu.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2014-07-24 19:10:23 +0000
committersin <sin@2f30.org>2014-07-30 20:07:47 +0100
commitaa69426670bf0ae480db127ff8d4fc62d6da2593 (patch)
tree622e5678736d9cbf2dbe7386f80e340ff223842e /dmenu.c
parent4c50e43df46e486a0fac632d34eaed37359ceba7 (diff)
downloaddmenu-aa69426670bf0ae480db127ff8d4fc62d6da2593.tar.gz
dmenu-aa69426670bf0ae480db127ff8d4fc62d6da2593.tar.bz2
dmenu-aa69426670bf0ae480db127ff8d4fc62d6da2593.zip
fix crash with ctrl-enter as input
reproduce: ./dmenu; send EOF; press ctrl+enter.
Diffstat (limited to 'dmenu.c')
-rw-r--r--dmenu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/dmenu.c b/dmenu.c
index dd2c128..b56f3a8 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -370,7 +370,8 @@ keypress(XKeyEvent *ev) {
puts((sel && !(ev->state & ShiftMask)) ? sel->text : text);
if(!(ev->state & ControlMask))
exit(EXIT_SUCCESS);
- sel->out = True;
+ if(sel)
+ sel->out = True;
break;
case XK_Right:
if(text[cursor] != '\0') {