]> Kevux Git Server - fll/commitdiff
Bugfix: is_word tests were using the wrong function and there is no ASCII zero-width...
authorKevin Day <thekevinday@gmail.com>
Sat, 2 May 2020 04:32:42 +0000 (23:32 -0500)
committerKevin Day <thekevinday@gmail.com>
Sat, 2 May 2020 04:32:42 +0000 (23:32 -0500)
level_0/f_utf/c/utf.c

index 08a3c4bdc45ee7fb3094c989a800976be9293e38..5573aea4ed2e403a80153f63dadc1a64a6cc68a9 100644 (file)
@@ -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;
     }