Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
dwm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
61a1910
)
applied yet another proposal of Manuel
author
arg@mig29
<unknown>
Sun, 26 Nov 2006 14:43:16 +0000
(15:43 +0100)
committer
arg@mig29
<unknown>
Sun, 26 Nov 2006 14:43:16 +0000
(15:43 +0100)
main.c
patch
|
blob
|
history
diff --git
a/main.c
b/main.c
index
f196df7
..
934bea4
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-284,8
+284,8
@@
main(int argc, char *argv[]) {
readin = False;
break;
default:
readin = False;
break;
default:
- stext[r - (stext[r - 1] == '\n' ? 1 : 0)] = '\0';
- for(p = stext + strlen(stext) - 1; p > stext && *p != '\n'; --p);
+ for(stext[r] = '\0', p = stext + strlen(stext) - 1; p >= stext && *p == '\n'; *p-- = '\0');
+ for(p = stext + strlen(stext) - 1; p >= stext && *p != '\n'; --p);
if(p > stext)
strncpy(stext, p + 1, sizeof stext);
}
if(p > stext)
strncpy(stext, p + 1, sizeof stext);
}