In chat_UpdateSet(), initialize the input buffer to prevent stale data

from previous timed out commands.

PR:		186530
Submitted by:	Alexander Zagrebin <alexz at visp.ru>
Reviewed by:	brian
MFC after:	1 week
This commit is contained in:
Christian Brueffer 2014-02-14 20:34:24 +00:00
parent b3448df413
commit 2df958167e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=261900

View File

@ -154,6 +154,11 @@ chat_UpdateSet(struct fdescriptor *d, fd_set *r, fd_set *w, fd_set *e, int *n)
else {
/* c->state = CHAT_EXPECT; */
c->argptr = &arg_term;
/*
We have to clear the input buffer, because it contains output
from the previous (timed out) command.
*/
c->bufstart = c->bufend;
}
c->TimedOut = 0;
}