From 6292566c1a39d3b70d5b4b6186d1c29bc2fb528b Mon Sep 17 00:00:00 2001 From: Michael Go Date: Mon, 17 Jul 2023 16:14:57 -0300 Subject: [PATCH] use isspace to check if a character matches regex's \s --- ext/liquid_c/raw.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ext/liquid_c/raw.c b/ext/liquid_c/raw.c index 86f84e51..992fdc38 100644 --- a/ext/liquid_c/raw.c +++ b/ext/liquid_c/raw.c @@ -31,9 +31,7 @@ static bool match_full_token_possibly_invalid(token_t *token, struct full_token_ char c = str[i]; // match \s - bool is_whitespace = ( - c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\v' || c == '\f' - ); + bool is_whitespace = isspace(c); if (!is_word_char(c) && !is_whitespace && c != '%' && c != '-') { match->delimiter_start = curr_delimiter_start = NULL;