From ec8aa03ce920386af780562fadecd8a3ffb41f2d Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 1 May 2020 23:32:42 -0500 Subject: [PATCH] Bugfix: is_word tests were using the wrong function and there is no ASCII zero-width space --- level_0/f_utf/c/utf.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/level_0/f_utf/c/utf.c b/level_0/f_utf/c/utf.c index 08a3c4b..5573aea 100644 --- a/level_0/f_utf/c/utf.c +++ b/level_0/f_utf/c/utf.c @@ -619,7 +619,7 @@ extern "C" { uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { - if (iscntrl(*character) || *character == '_') { + if (isalnum(*character) || *character == '_') { return f_true; } @@ -653,7 +653,7 @@ extern "C" { uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { - if (iscntrl(*character) || *character == '_' || *character == '-') { + if (isalnum(*character) || *character == '_' || *character == '-') { return f_true; } @@ -687,10 +687,7 @@ extern "C" { uint8_t width = f_macro_utf_byte_width_is(*character); if (width == 0) { - if (isspace(*character)) { - return f_true; - } - + // There are no zero-width spaces in ASCII. return f_false; } -- 1.8.3.1