]> Kevux Git Server - fll/commitdiff
Bugfix: FSS Extended List is not detecting end properly.
authorKevin Day <thekevinday@gmail.com>
Thu, 6 May 2021 22:40:43 +0000 (17:40 -0500)
committerKevin Day <thekevinday@gmail.com>
Thu, 6 May 2021 22:40:43 +0000 (17:40 -0500)
If the content is something like:
example {
}

There is no Content.
This is not being detected correctly an the '}' is being included.

There are two problems here:
1) The current position at the end should be after the eol and not that last newline.
2) If the current position matches the start position, then it needs to be explicitly designated as empty.

level_1/fl_fss/c/fss_extended_list.c

index 077d26d644558b82a371087578551879e6893c3d..78fc5233715b0a31e1ea4b7033ef10992fc7155e 100644 (file)
@@ -372,7 +372,16 @@ extern "C" {
 
         // found a valid content close, set stop point to last newline.
         if (buffer.string[range->start] == f_fss_eol) {
-          range->start = newline_last + 1;
+          ++range->start;
+
+          // If the last newline is the entire start, then there is no Content.
+          if (newline_last == found->array[found->used].start) {
+            found->array[found->used].start = 1;
+            found->array[found->used++].stop = 0;
+
+            return FL_fss_found_content_not;
+          }
+
           found->array[found->used++].stop = newline_last;
 
           return FL_fss_found_content;