Blame 0020-ignore-prompt-if-it-is-empty-in-addition-to-NULL.patch
|
|
20de4fd |
From 1299e41447fe5850d127857a68f37c5badd491ce Mon Sep 17 00:00:00 2001
|
|
|
20de4fd |
From: Moritz Wilhelmy <moritz+hg@wzff.de>
|
|
|
20de4fd |
Date: Tue, 15 May 2012 11:47:54 +0200
|
|
|
20de4fd |
Subject: [PATCH 20/28] ignore prompt if it is empty in addition to NULL
|
|
|
20de4fd |
|
|
|
20de4fd |
---
|
|
|
20de4fd |
dmenu.c | 4 ++--
|
|
|
20de4fd |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
20de4fd |
|
|
|
20de4fd |
diff --git a/dmenu.c b/dmenu.c
|
|
|
20de4fd |
index f7eba87..3962801 100644
|
|
|
20de4fd |
--- a/dmenu.c
|
|
|
20de4fd |
+++ b/dmenu.c
|
|
|
20de4fd |
@@ -169,7 +169,7 @@ drawmenu(void) {
|
|
|
20de4fd |
dc->h = bh;
|
|
|
20de4fd |
drawrect(dc, 0, 0, mw, mh, True, BG(dc, normcol));
|
|
|
20de4fd |
|
|
|
20de4fd |
- if(prompt) {
|
|
|
20de4fd |
+ if(prompt && *prompt) {
|
|
|
20de4fd |
dc->w = promptw;
|
|
|
20de4fd |
drawtext(dc, prompt, selcol);
|
|
|
20de4fd |
dc->x = dc->w;
|
|
|
20de4fd |
@@ -579,7 +579,7 @@ setup(void) {
|
|
|
20de4fd |
y = topbar ? 0 : DisplayHeight(dc->dpy, screen) - mh;
|
|
|
20de4fd |
mw = DisplayWidth(dc->dpy, screen);
|
|
|
20de4fd |
}
|
|
|
20de4fd |
- promptw = prompt ? textw(dc, prompt) : 0;
|
|
|
20de4fd |
+ promptw = (prompt && *prompt) ? textw(dc, prompt) : 0;
|
|
|
20de4fd |
inputw = MIN(inputw, mw/3);
|
|
|
20de4fd |
match();
|
|
|
20de4fd |
|
|
|
20de4fd |
--
|
|
|
20de4fd |
1.9.0
|
|
|
20de4fd |
|