for (i = 0; i < size; i++) {
ret = rdline_char_in(&cl->rdl, buf[i]);
+ if (ret == RDLINE_RES_VALIDATED &&
+ cl->rdl.status == RDLINE_STOPPED)
+ break;
+
if (ret == RDLINE_RES_VALIDATED)
rdline_newline(&cl->rdl, cl->prompt);
else if (ret == RDLINE_RES_EOF)
rdl->validate = validate;
rdl->complete = complete;
rdl->help = help;
- rdl->status = RDLINE_INIT;
+ rdl->status = RDLINE_STOPPED;
#ifndef NO_RDLINE_HISTORY
cirbuf_init(&rdl->history, rdl->history_buf, 0, RDLINE_HISTORY_BUF_SIZE);
#endif /* !NO_RDLINE_HISTORY */
void
rdline_stop(struct rdline *rdl)
{
- rdl->status = RDLINE_INIT;
+ rdl->status = RDLINE_STOPPED;
}
void
}
rdline_asyncpager_reset(rdl);
- rdl->status = RDLINE_INIT;
#else
if (rdl->status == RDLINE_EXITED)
return RDLINE_RES_EXITED;