projects
/
suckless
/
dwm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b8985dc
)
made error handling more proper
author
Anselm R. Garbe
<garbeam@gmail.com>
Fri, 2 Nov 2007 16:04:40 +0000
(17:04 +0100)
committer
Anselm R. Garbe
<garbeam@gmail.com>
Fri, 2 Nov 2007 16:04:40 +0000
(17:04 +0100)
dwm.c
patch
|
blob
|
history
diff --git
a/dwm.c
b/dwm.c
index 77727a82baa73b2e821e3ad39518f24f4853e20a..c595a5154dc2654aeed771ce738d1789db8fde82 100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-1302,8
+1302,13
@@
run(void) {
if(FD_ISSET(STDIN_FILENO, &rd)) {
if(stext == fgets(stext, sizeof stext - 1, stdin))
stext[strlen(stext) - 1] = '\0'; /* remove tailing '\n' */
- else
- strncpy(stext, strerror(errno), sizeof stext - 1);
+ else {
+ readin = False;
+ if(feof(stdin))
+ strncpy(stext, "EOF", 4);
+ else /* error occured */
+ strncpy(stext, strerror(errno), sizeof stext - 1);
+ }
drawbar();
}
while(XPending(dpy)) {