From 4e0db97856b4c788ed3c37a370838b141242448d Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 13 Oct 2026 23:56:04 -0500 Subject: [PATCH] Progress: Fix problems exposed by unit tests. Assigning `range.start` to `newline_last` in basic list should only increment when `newline_last` is not the same value as `begin`. The combining joiner skip code must also set the `line_stop` before continuing. Add a comment to clarify some code that uses the found variable for a different purpose. --- level_1/fl_fss/c/fss/basic_list.c | 2 +- level_1/fl_fss/c/private-fss-list.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/level_1/fl_fss/c/fss/basic_list.c b/level_1/fl_fss/c/fss/basic_list.c index 5958cc4c4..412983d9f 100644 --- a/level_1/fl_fss/c/fss/basic_list.c +++ b/level_1/fl_fss/c/fss/basic_list.c @@ -245,7 +245,7 @@ extern "C" { range->start = newline_last; } else { - range->start = newline_last + 1; + range->start = begin == newline_last ? newline_last : newline_last + 1; found->array[found->used++].stop = newline_last; } diff --git a/level_1/fl_fss/c/private-fss-list.c b/level_1/fl_fss/c/private-fss-list.c index 808ef1389..76652f9f6 100644 --- a/level_1/fl_fss/c/private-fss-list.c +++ b/level_1/fl_fss/c/private-fss-list.c @@ -79,7 +79,7 @@ extern "C" { uint8_t flag_fl = ___fl_flag_has_graph_first___; - found->start = range->start; + found->start = begin; // Identify where the object ends. while (F_status_is_error_not(state->status) && range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) { @@ -229,6 +229,7 @@ extern "C" { } } // while + // Use the found range to test the buffer decrement. range->start = found->stop + 1; found->start = line_stop; found->stop = line_stop; @@ -267,6 +268,8 @@ extern "C" { f_fss_skip_past_combining_joiner(buffer, range, state); + line_stop = range->start; + continue; } @@ -306,6 +309,8 @@ extern "C" { if (f_fss_is_combining_joiner(buffer, *range, state) == F_true) { f_fss_skip_past_combining_joiner(buffer, range, state); + line_stop = range->start; + continue; } } -- 2.52.0