Update
This commit is contained in:
parent
de6b1bcbf0
commit
9dde5fc33f
15
command.c
15
command.c
|
@ -538,8 +538,6 @@ bool command_network_send(const char *cmd_)
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef HAVE_STDIN_CMD
|
||||
static bool command_stdin_init(command_t *handle)
|
||||
{
|
||||
|
@ -597,22 +595,20 @@ error:
|
|||
#ifdef HAVE_STDIN_CMD
|
||||
static void command_stdin_poll(command_t *handle)
|
||||
{
|
||||
ssize_t ret;
|
||||
ptrdiff_t msg_len;
|
||||
char *last_newline = NULL;
|
||||
|
||||
if (!handle->stdin_enable)
|
||||
return;
|
||||
|
||||
ret = read_stdin(handle->stdin_buf + handle->stdin_buf_ptr,
|
||||
ssize_t ret = read_stdin(
|
||||
handle->stdin_buf + handle->stdin_buf_ptr,
|
||||
STDIN_BUF_SIZE - handle->stdin_buf_ptr - 1);
|
||||
|
||||
if (ret == 0)
|
||||
return;
|
||||
|
||||
handle->stdin_buf_ptr += ret;
|
||||
handle->stdin_buf[handle->stdin_buf_ptr] = '\0';
|
||||
|
||||
last_newline = strrchr(handle->stdin_buf, '\n');
|
||||
last_newline =
|
||||
strrchr(handle->stdin_buf, '\n');
|
||||
|
||||
if (!last_newline)
|
||||
{
|
||||
|
@ -645,6 +641,7 @@ bool command_poll(command_t *handle)
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_STDIN_CMD
|
||||
if (handle->stdin_enable)
|
||||
command_stdin_poll(handle);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue