From: Anselm R. Garbe Date: Fri, 2 Nov 2007 16:07:14 +0000 (+0100) Subject: simplified X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=af4667a85a11a1c001e60894a7ec7458c208bc0d;p=dwm.git simplified --- diff --git a/dwm.c b/dwm.c index c595a51..266dd15 100644 --- a/dwm.c +++ b/dwm.c @@ -1300,15 +1300,12 @@ run(void) { eprint("select failed\n"); } if(FD_ISSET(STDIN_FILENO, &rd)) { - if(stext == fgets(stext, sizeof stext - 1, stdin)) + if((readin = (stext == fgets(stext, sizeof stext - 1, stdin)))) stext[strlen(stext) - 1] = '\0'; /* remove tailing '\n' */ - else { - readin = False; - if(feof(stdin)) - strncpy(stext, "EOF", 4); - else /* error occured */ - strncpy(stext, strerror(errno), sizeof stext - 1); - } + else if(feof(stdin)) + strncpy(stext, "EOF", 4); + else /* error occured */ + strncpy(stext, strerror(errno), sizeof stext - 1); drawbar(); } while(XPending(dpy)) {