From d06f6dcc7fae6a3cf33905f6053ff0bd06118df1 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 6 May 2021 17:40:43 -0500 Subject: [PATCH] Bugfix: FSS Extended List is not detecting end properly. 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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/level_1/fl_fss/c/fss_extended_list.c b/level_1/fl_fss/c/fss_extended_list.c index 077d26d..78fc523 100644 --- a/level_1/fl_fss/c/fss_extended_list.c +++ b/level_1/fl_fss/c/fss_extended_list.c @@ -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; -- 1.8.3.1