From: mdw Date: Sat, 22 May 1999 13:38:50 +0000 (+0000) Subject: Fix bug which discarded initial portions of incomplete lines. X-Git-Tag: 2.0.4~300 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/commitdiff_plain/64cc9e7ab19cc3edb7f57c9d4389e94846852f96?ds=sidebyside Fix bug which discarded initial portions of incomplete lines. --- diff --git a/lbuf.c b/lbuf.c index 63eb447..118250d 100644 --- a/lbuf.c +++ b/lbuf.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: lbuf.c,v 1.2 1999/05/17 20:36:08 mdw Exp $ + * $Id: lbuf.c,v 1.3 1999/05/22 13:38:50 mdw Exp $ * * Block-to-line buffering * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: lbuf.c,v $ + * Revision 1.3 1999/05/22 13:38:50 mdw + * Fix bug which discarded initial portions of incomplete lines. + * * Revision 1.2 1999/05/17 20:36:08 mdw * Make the magical constants for the buffer flags uppercase. * @@ -207,7 +210,7 @@ size_t lbuf_free(lbuf *b, char **p) * reason this routine exists. */ - if (b->len == 0 || b->len == sizeof(b->buf)) { + if (b->len != 0 && b->len != sizeof(b->buf)) { *p = b->buf + b->len; return (sizeof(b->buf) - b->len); } else {