make sure the cbuf is usable when text gets added

This commit is contained in:
Bill Currie 2003-04-15 19:40:46 +00:00
parent 37fa93e8e5
commit 0421c33b85

View file

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