mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Don't add null characters to the expect buffer
They prevent regexec() from seeing the remainder of the buffer.
This commit is contained in:
parent
f716d2ccdd
commit
39b36beb79
1 changed files with 5 additions and 0 deletions
|
|
@ -207,6 +207,11 @@ static int write_(lua_State *L)
|
||||||
// Function to add a character to the circular expect buffer
|
// Function to add a character to the circular expect buffer
|
||||||
static void expect_buffer_add(char c)
|
static void expect_buffer_add(char c)
|
||||||
{
|
{
|
||||||
|
if (!c)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (buffer_size < MAX_BUFFER_SIZE)
|
if (buffer_size < MAX_BUFFER_SIZE)
|
||||||
{
|
{
|
||||||
circular_buffer[buffer_size++] = c;
|
circular_buffer[buffer_size++] = c;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue