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); }