]> Kevux Git Server - fll/commitdiff
Progress: Fix problems exposed by unit tests.
authorKevin Day <Kevin@kevux.org>
Wed, 14 Oct 2026 04:56:04 +0000 (23:56 -0500)
committerKevin Day <Kevin@kevux.org>
Wed, 14 Oct 2026 04:56:04 +0000 (23:56 -0500)
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
level_1/fl_fss/c/private-fss-list.c

index 5958cc4c46cfcb01447b9df30630f039a510e54a..412983d9fb283d564c3d6c22522511bf99ab860c 100644 (file)
@@ -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;
           }
 
index 808ef138911b53a1ef058c87d03959a764a4887f..76652f9f67c673d15f67ef767bb1918740cbcc2a 100644 (file)
@@ -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;
           }
         }