From: Kevin Day Date: Thu, 6 May 2021 22:40:43 +0000 (-0500) Subject: Bugfix: FSS Extended List is not detecting end properly. X-Git-Tag: 0.5.4~45 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=d06f6dcc7fae6a3cf33905f6053ff0bd06118df1;p=fll 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. --- 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;