From 6cc84675b59a7be71e45eeab906b87a7519f6993 Mon Sep 17 00:00:00 2001 From: Deven Blake Date: Sun, 16 May 2021 00:52:07 -0400 Subject: [PATCH] LOL ONLY SORTA WORKS :SHRUG: --- dmenubar/dmenubar.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dmenubar/dmenubar.c b/dmenubar/dmenubar.c index 1eb60ae..ee1cd35 100644 --- a/dmenubar/dmenubar.c +++ b/dmenubar/dmenubar.c @@ -253,12 +253,17 @@ main(int argc, char *argv[]) setup(); - do{ + /* might seem elementary but i made this mistake: + * you can't just let it exit 0 when you hit EOF because then + * stuff like `printf "hello\n" | dmenubar` won't have time to + * be shown. */ + for(;;){ + fgets(text, text_s, stdin); /* fgets adds a newline which will be printable in some fonts */ if(strlen(text) > 0) text[strlen(text)-1] = '\0'; drawmenu(text); - }while(fgets(text, text_s, stdin) != NULL); + } - return 0; + return 1; /* unreachable */ }