From: Kevin Day Date: Tue, 20 Aug 2024 23:58:06 +0000 (-0500) Subject: Bugfix: The FSS Embedded Read is incorrectly handling empty Content. X-Git-Tag: 0.7.0~93 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=e9fd069a8f1892c1918c0c1f71880b378c8790f2;p=fll Bugfix: The FSS Embedded Read is incorrectly handling empty Content. The empty Content is being incorrectly handled as noted in the 0.6 commit 93a70bece8ecdb30801744e492fec8bb2601d2a4. The '}' gets printed on empty Content, which is invalid. Set the range to out of range when the start position is the line start. This should only happen for empty Content because valid Content is only closed when '}' is on its own line. --- diff --git a/level_1/fl_fss/c/fss/embedded_list.c b/level_1/fl_fss/c/fss/embedded_list.c index 5d6ed99..ca20a75 100644 --- a/level_1/fl_fss/c/fss/embedded_list.c +++ b/level_1/fl_fss/c/fss/embedded_list.c @@ -576,8 +576,16 @@ extern "C" { found->depth[depth].array[position].object.stop = cache->objects->array[depth].stop; } - found->depth[depth].array[position].content.array[0].start = cache->positions->array[depth]; - found->depth[depth].array[position].content.array[0].stop = newline_last; + // The Content is empty when line_start is the same as the start position. + if (line_start == cache->positions->array[depth]) { + found->depth[depth].array[position].content.array[0].start = 1; + found->depth[depth].array[position].content.array[0].stop = 0; + } + else { + found->depth[depth].array[position].content.array[0].start = cache->positions->array[depth]; + found->depth[depth].array[position].content.array[0].stop = newline_last; + } + found->depth[depth].array[position].content.used = 1; if (position >= found->depth[depth].used) {