From 0421c33b85bf19281d13bfc6db452bec3153f128 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 15 Apr 2003 19:40:46 +0000 Subject: [PATCH] make sure the cbuf is usable when text gets added --- libs/util/cbuf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/util/cbuf.c b/libs/util/cbuf.c index 9abf403ff..ac45156d3 100644 --- a/libs/util/cbuf.c +++ b/libs/util/cbuf.c @@ -156,12 +156,16 @@ Cbuf_PushStack (cbuf_interpreter_t *interp) void Cbuf_AddText (cbuf_t *cbuf, const char *text) { + if (cbuf->state == CBUF_STATE_JUNK) + cbuf->state = CBUF_STATE_NORMAL; cbuf->interpreter->add (cbuf, text); } void Cbuf_InsertText (cbuf_t *cbuf, const char *text) { + if (cbuf->state == CBUF_STATE_JUNK) + cbuf->state = CBUF_STATE_NORMAL; cbuf->interpreter->insert (cbuf, text); }