aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Wilhelmy2012-05-15 11:47:54 +0200
committerMoritz Wilhelmy2012-05-15 11:47:54 +0200
commit1299e41447fe5850d127857a68f37c5badd491ce (patch)
tree85b9d086837763952d6441cd024578c4d6711311
parent38fccafada4eee3e4e0301d7c6eadd3c5788b305 (diff)
ignore prompt if it is empty in addition to NULL
-rw-r--r--dmenu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dmenu.c b/dmenu.c
index f7eba87..3962801 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -169,7 +169,7 @@ drawmenu(void) {
dc->h = bh;
drawrect(dc, 0, 0, mw, mh, True, BG(dc, normcol));
- if(prompt) {
+ if(prompt && *prompt) {
dc->w = promptw;
drawtext(dc, prompt, selcol);
dc->x = dc->w;
@@ -579,7 +579,7 @@ setup(void) {
y = topbar ? 0 : DisplayHeight(dc->dpy, screen) - mh;
mw = DisplayWidth(dc->dpy, screen);
}
- promptw = prompt ? textw(dc, prompt) : 0;
+ promptw = (prompt && *prompt) ? textw(dc, prompt) : 0;
inputw = MIN(inputw, mw/3);
match();