From e9fd069a8f1892c1918c0c1f71880b378c8790f2 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 20 Aug 2024 18:58:06 -0500 Subject: [PATCH] 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. --- level_1/fl_fss/c/fss/embedded_list.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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) { -- 1.8.3.1