[hackers] [dwm] simplified

From: Anselm R. Garbe <garbeam_AT_gmail.com>
Date: Fri Nov 02 17:12:05 2007

changeset: 1053:9990c1b25ceb
tag: tip
user: Anselm R. Garbe <garbeam_AT_gmail.com>
date: Fri Nov 02 17:07:14 2007 +0100
summary: simplified

diff -r aef45cdbcb11 -r 9990c1b25ceb dwm.c
--- a/dwm.c Fri Nov 02 17:04:40 2007 +0100
+++ b/dwm.c Fri Nov 02 17:07:14 2007 +0100
@@ -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)) {
Received on Fri Nov 02 2007 - 17:12:05 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:58:40 UTC