/* -*-c-*-
*
- * $Id: lbuf.c,v 1.4 2000/06/17 10:38:14 mdw Exp $
+ * $Id: lbuf.c,v 1.5 2001/02/03 16:23:33 mdw Exp $
*
* Block-to-line buffering
*
/*----- Revision history --------------------------------------------------*
*
* $Log: lbuf.c,v $
+ * Revision 1.5 2001/02/03 16:23:33 mdw
+ * Bug fix: handle a disable during a close-induced flush without dumping
+ * core.
+ *
* Revision 1.4 2000/06/17 10:38:14 mdw
* Add support for variable buffer sizes.
*
char *base; /* Base address of current line */
int cr; /* Carriage return state */
+ if (b->f & LBUF_CLOSE) {
+ b->func(0, b->p);
+ return;
+ }
+
/* --- Initialize variables as necessary --- */
if (!p) {
x_free(b->a, b->buf);
b->buf = 0;
}
+ b->f |= LBUF_CLOSE;
if (b->f & LBUF_ENABLE)
b->func(0, b->p);
}