]> Kevux Git Server - fll/commitdiff
Update: f_fss_count_slash() should not seek past combining joiners.
authorKevin Day <Kevin@kevux.org>
Tue, 3 Nov 2026 01:25:17 +0000 (19:25 -0600)
committerKevin Day <Kevin@kevux.org>
Tue, 3 Nov 2026 01:25:17 +0000 (19:25 -0600)
Stop at the first combining/joiner found and let the caller handle this situation.

level_0/f_fss/c/fss.c
level_0/f_fss/c/fss.h
level_0/f_fss/tests/unit/c/test-fss-count_slash.c

index 81d12be..6bb7e99 100644 (file)
@@ -179,13 +179,6 @@ extern "C" {
 
           // A combining joiner invalidates as slash immediately before it and there is only a preceding slash if count > initial.
           if (*count > initial) --(*count);
-
-          const f_status_t status = state->status;
-
-          private_f_fss_skip_past_combining_joiner(buffer, range, state);
-          if (F_status_is_error(state->status)) return;
-
-          state->status = status;
         }
 
         return;
index 011ef85..d5c801d 100644 (file)
@@ -169,12 +169,15 @@ extern "C" {
 /**
  * Count the number of slashes from the given range in the buffer.
  *
- * Use this to helpm determine how to apply slash delimits.
+ * Use this to help determine how to apply slash delimits.
  *
  * This does not initialize count, instead it only performs addition to line.
  *
  * This skips past (ignores) NULL (f_fss_placeholder_s).
  *
+ * This stops as the first combining or joiner character found.
+ * Thsis does not continue or seek past the first combining or joiner character found.
+ *
  * @param buffer
  *   The string to process.
  * @param range
index c69105c..f8d4115 100644 (file)
@@ -156,10 +156,10 @@ void test__f_fss_count_slash__works(void **state) {
     2,                    // "\\"
     1,                    // "\\"
     buffers[15].used + 1, // "F_data_not"
-    4,                    // "\\́"
-    4,                    // "\\⁠J"
-    5,                    // "\\\\́"
-    5,                    // "\\\\⁠J"
+    1,                    // "\\́"
+    1,                    // "\\⁠J"
+    2,                    // "\\\\́"
+    2,                    // "\\\\⁠J"
   };
 
   for (uint8_t i = 0; i < 20; ++i) {