]> git.pond.sub.org Git - empserver/commitdiff
Fix client to log long input lines untruncated
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 14 Apr 2011 18:42:42 +0000 (20:42 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 14 Apr 2011 18:42:47 +0000 (20:42 +0200)
They can still get split by output arriving between two reads from
input, but that's unavoidable, because the client is designed to read
and write big chunks, not lines.

src/client/play.c

index 4979bae5b24c821296fed6f6bb0f841c2028de6f..03718c79a25e7da8284cedbfb972432167782dec 100644 (file)
@@ -432,11 +432,11 @@ recv_input(int fd, struct ring *inbuf)
        assert(ch != EOF);
        if (ch != '\r' && lbuf_putc(&cmdbuf, ch) > 0) {
            line = lbuf_line(&cmdbuf);
-           if (auxfp)
-               fputs(line, auxfp);
            save_input(line);
            lbuf_init(&cmdbuf);
        }
+       if (auxfp)
+           putc(ch, auxfp);
     }
 
     return res;