]> Kevux Git Server - fll/commitdiff
Update: Improve Basic List content read return handling when at end range or buffer.
authorKevin Day <Kevin@kevux.org>
Fri, 25 Sep 2026 21:58:27 +0000 (16:58 -0500)
committerKevin Day <Kevin@kevux.org>
Fri, 25 Sep 2026 21:58:27 +0000 (16:58 -0500)
The return state returns `F_okay_eos` or `F_okay_stop` accordingly.
This can be inferred to be content found, but not consistently.
It is better to return `F_content_found`.
Anything using this can now more consistently rely on the `F_content_found` status.
The end of string and buffer location checks should already be being performed by the caller anyway.

The **API** doesn't go into details on this behavior which leaves room for this change without breaking **API** or **ABI**.

This is back ported from ongoing changed from the `0.8` branch.

level_1/fl_fss/c/fss/basic_list.c

index efcd5ecea811f92dd3f98d3d664c8c5b5e1493b3..0f96ddf25743025c8ffe56406b494681719bf28f 100644 (file)
@@ -280,20 +280,16 @@ extern "C" {
       return status;
     }
 
-    if (range->start >= buffer.used) {
-      found->array[found->used].stop = buffer.used - 1;
-
-      return F_none_eos;
-    }
-
-    if (range->start > range->stop) {
-      found->array[found->used].stop = range->stop;
-
-      return F_none_stop;
-    }
-
     if (range->start > begin) {
-      found->array[found->used++].stop = range->start - 1;
+      if (range->start >= buffer.used) {
+        found->array[found->used++].stop = buffer.used - 1;
+      }
+      else if (range->start > range->stop) {
+        found->array[found->used++].stop = range->stop;
+      }
+      else {
+        found->array[found->used++].stop = range->start - 1;
+      }
     }
     else {
       found->array[found->used].start = 1;