Skip to content

Commit

Permalink
[utf] Own definition of isspace. Refs #249
Browse files Browse the repository at this point in the history
  • Loading branch information
rkd77 committed Jul 31, 2023
1 parent 4ef70a1 commit 03ad2b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/util/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 == ' ';
}
4 changes: 4 additions & 0 deletions src/util/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 03ad2b8

Please sign in to comment.