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)