about summary refs log tree commit diff stats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/main.c b/main.c
index f09307b..86d72fa 100644
--- a/main.c
+++ b/main.c
@@ -165,7 +165,6 @@ main(int argc, char *argv[])
 	int i;
 	unsigned int mask;
 	fd_set rd;
-	Bool readin = True;
 	Window w;
 	XEvent ev;
 	XSetWindowAttributes wa;
@@ -252,8 +251,7 @@ main(int argc, char *argv[])
 	/* main event loop, reads status text from stdin as well */
 	while(running) {
 		FD_ZERO(&rd);
-		if(readin)
-			FD_SET(STDIN_FILENO, &rd);
+		FD_SET(STDIN_FILENO, &rd);
 		FD_SET(ConnectionNumber(dpy), &rd);
 
 		i = select(ConnectionNumber(dpy) + 1, &rd, 0, 0, 0);
@@ -269,12 +267,11 @@ main(int argc, char *argv[])
 						(handler[ev.type])(&ev); /* call handler */
 				}
 			}
-			if(readin && FD_ISSET(STDIN_FILENO, &rd)) {
-				readin = NULL != fgets(stext, sizeof(stext), stdin);
-				if(readin)
-					stext[strlen(stext) - 1] = 0;
+			if(FD_ISSET(STDIN_FILENO, &rd)) {
+				if(!fgets(stext, sizeof(stext), stdin))
+					break;
 				else 
-					strcpy(stext, "broken pipe");
+					stext[strlen(stext) - 1] = 0;
 				drawstatus();
 			}
 		}
01:11:03 +0100 committer James Booth <boothj5@gmail.com> 2015-05-17 01:11:03 +0100 Added stabber testsuite' href='/danisanti/profani-tty/commit/stabbertests/testsuite.c?id=97c5072f56b992d3bf2e4c3550a8010f9638b80a'>97c5072f ^
52e2917b ^

97c5072f ^


e295a474 ^
52e2917b ^




f17afcf5 ^
52e2917b ^

f17afcf5 ^
52e2917b ^
a522d022 ^
52e2917b ^












373f47c7 ^
52e2917b ^

c6ff761a ^
52e2917b ^





5e324e40 ^
52e2917b ^



d54cbf12 ^


d40998c4 ^
97c5072f ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74