From 0105346a11674e94f3b3d21cce2c8a15b4fe1322 Mon Sep 17 00:00:00 2001 From: Martin Lund Date: Fri, 19 Apr 2024 16:56:30 +0200 Subject: [PATCH] Cleanup --- src/script.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/script.c b/src/script.c index 243ae0c..c19fe95 100644 --- a/src/script.c +++ b/src/script.c @@ -215,8 +215,8 @@ static int send(lua_State *L) return 1; } -// Function to add a character to the circular buffer -void add_to_buffer(char c) +// Function to add a character to the circular expect buffer +static void expect_buffer_add(char c) { if (buffer_size < MAX_BUFFER_SIZE) { @@ -230,8 +230,8 @@ void add_to_buffer(char c) } } -// Function to match against the circular buffer using regex -bool match_regex(regex_t *regex) +// Function to match against the circular expect buffer using regex +static bool match_regex(regex_t *regex) { char buffer[MAX_BUFFER_SIZE + 1]; // Temporary buffer for regex matching const char *s = circular_buffer; @@ -306,7 +306,7 @@ static int expect(lua_State *L) if (bytes_read > 0) { putchar(c); - add_to_buffer(c); + expect_buffer_add(c); // Match against the entire buffer if (match_regex(®ex)) {