From 5f1d2f06e38b80e464a4cca3bb4911cdb9f929b2 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 2 Nov 2026 19:25:17 -0600 Subject: [PATCH] Update: f_fss_count_slash() should not seek past combining joiners. Stop at the first combining/joiner found and let the caller handle this situation. --- level_0/f_fss/c/fss.c | 7 ------- level_0/f_fss/c/fss.h | 5 ++++- level_0/f_fss/tests/unit/c/test-fss-count_slash.c | 8 ++++---- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/level_0/f_fss/c/fss.c b/level_0/f_fss/c/fss.c index 81d12beaa..6bb7e99d6 100644 --- a/level_0/f_fss/c/fss.c +++ b/level_0/f_fss/c/fss.c @@ -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; diff --git a/level_0/f_fss/c/fss.h b/level_0/f_fss/c/fss.h index 011ef85e6..d5c801dec 100644 --- a/level_0/f_fss/c/fss.h +++ b/level_0/f_fss/c/fss.h @@ -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 diff --git a/level_0/f_fss/tests/unit/c/test-fss-count_slash.c b/level_0/f_fss/tests/unit/c/test-fss-count_slash.c index c69105cdc..f8d4115ea 100644 --- a/level_0/f_fss/tests/unit/c/test-fss-count_slash.c +++ b/level_0/f_fss/tests/unit/c/test-fss-count_slash.c @@ -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) { -- 2.52.0