From 03ad2b8c2e1e3260370f8f9cf392758cef28260c Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Mon, 31 Jul 2023 23:23:25 +0200 Subject: [PATCH] [utf] Own definition of isspace. Refs #249 --- src/util/string.c | 6 ++++++ src/util/string.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/util/string.c b/src/util/string.c index 4a4f687e9..05bdc2864 100644 --- a/src/util/string.c +++ b/src/util/string.c @@ -699,3 +699,9 @@ free_ecmascript_string_list(LIST_OF(struct ecmascript_string_list_item) *list) mem_free(item); } } + +int +elinks_isspace(int c) +{ + return c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r' || c == ' '; +} diff --git a/src/util/string.h b/src/util/string.h index eaa505fd3..da57d9efc 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -124,6 +124,10 @@ char * c_strcasestr(const char *haystack, const char *needle); /** @} */ +int elinks_isspace(int c); + +#undef isspace +#define isspace elinks_isspace #define skip_space(S) \ do { while (isspace((unsigned char)*(S))) (S)++; } while (0)