From 64cc9e7ab19cc3edb7f57c9d4389e94846852f96 Mon Sep 17 00:00:00 2001 Message-Id: <64cc9e7ab19cc3edb7f57c9d4389e94846852f96.1714848689.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sat, 22 May 1999 13:38:50 +0000 Subject: [PATCH 1/1] Fix bug which discarded initial portions of incomplete lines. Organization: Straylight/Edgeware From: mdw --- lbuf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 { -- [mdw]