Cosmetic changes in pushl. - irc - Unnamed repository; edit this file 'description' to name the repository.
(HTM) git clone git://vernunftzentrum.de/irc.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit ec9dab336522a0282804bfa0aa0b3c79a5630faa
(DIR) parent d29cd51fd4ed8c891bbe6efd7b4f9b5cf67e96e1
(HTM) Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Fri, 3 Apr 2015 03:03:04 +0000
Cosmetic changes in pushl.
Diffstat:
irc.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
---
(DIR) 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;
+ }
}
}