chiark / gitweb /
Fix bug which discarded initial portions of incomplete lines.
authormdw <mdw>
Sat, 22 May 1999 13:38:50 +0000 (13:38 +0000)
committermdw <mdw>
Sat, 22 May 1999 13:38:50 +0000 (13:38 +0000)
lbuf.c

diff --git a/lbuf.c b/lbuf.c
index 63eb4471bbd8c8023661d63c71117412a9dea258..118250d43f40c3d7d9b93c851d7c0dfa78e22af6 100644 (file)
--- 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 {