Cosmetic changes in pushl. - irc - Unnamed repository; edit this file 'descript… | |
git clone git://vernunftzentrum.de/irc.git | |
Log | |
Files | |
Refs | |
README | |
--- | |
commit ec9dab336522a0282804bfa0aa0b3c79a5630faa | |
parent d29cd51fd4ed8c891bbe6efd7b4f9b5cf67e96e1 | |
Author: Quentin Carbonneaux <[email protected]> | |
Date: Fri, 3 Apr 2015 03:03:04 +0000 | |
Cosmetic changes in pushl. | |
Diffstat: | |
irc.c | 17 ++++++++--------- | |
1 file changed, 8 insertions(+), 9 deletions(-) | |
--- | |
diff --git a/irc.c b/irc.c | |
@@ -184,24 +184,23 @@ chdel(char *name) | |
static char * | |
pushl(char *p, char *e) | |
{ | |
- int x=0; | |
+ int x; | |
char *w; | |
if ((w=memchr(p, '\n', e-p))) e=w+1; | |
- for (w=p;;) { | |
- if (p>=e || *p==' ' || p-w+INDENT>=scr.x-1) { | |
- for (; w<p; w++) | |
- waddch(scr.mw, *w); | |
- if (p>=e) return e; | |
- } | |
- p++; | |
- if (++x>=scr.x) { | |
+ for (w=p, x=0;; p++, x++) { | |
+ if (x>=scr.x) { | |
waddch(scr.mw, '\n'); | |
for (x=0; x<INDENT; x++) | |
waddch(scr.mw, ' '); | |
if (*w==' ') w++; | |
x+=p-w; | |
} | |
+ if (p>=e || *p==' ' || p-w+INDENT>=scr.x-1) { | |
+ for (; w<p; w++) | |
+ waddch(scr.mw, *w); | |
+ if (p>=e) return e; | |
+ } | |
} | |
} | |