From: ian Date: Fri, 11 Apr 2008 19:04:35 +0000 (+0000) Subject: only autoflush if the message ends with \n X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=322772c51b7c7dddf3927ada7dd6c3c9d5adbc82;p=trains.git only autoflush if the message ends with \n --- diff --git a/hostside/obc.c b/hostside/obc.c index 33ab3f2..8534890 100644 --- a/hostside/obc.c +++ b/hostside/obc.c @@ -63,7 +63,8 @@ static void addlink(OutBufferChain *ch, OutBuffer *ob) { events->on_fd(events, ch->fd, OOP_WRITE, writeable, ch); LIST_LINK_TAIL(ch->obs, ob); ch->total += ob->l; - obc_tryflush(ch); + if (ob->l>0 && ob->m[ob->l-1]=='\n') + obc_tryflush(ch); if (ch->total > ch->limit) { char what[128]; snprintf(what,sizeof(what)-1,"`%.*s...'", ob->l,ob->m);