From be7ada611fefcfd28735b362cebf88e9a8ebd0ca Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 31 Mar 2012 15:19:34 -0500 Subject: [PATCH] Bugfix: be sure to delimit trailing \ if it is an the end of a quoted content What happens is that if the content is (ignore single quotes): 'hell o\'. The fss extended content conversion should be (include double quotes): "hell o\\". The code must realize that the last \ is a would end up before a quote, or one would get: "hell o\". That content string would then be classified as an unterminated group. --- level_1/fl_fss/c/fss_extended.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/level_1/fl_fss/c/fss_extended.c b/level_1/fl_fss/c/fss_extended.c index c3f10e0..56b4970 100644 --- a/level_1/fl_fss/c/fss_extended.c +++ b/level_1/fl_fss/c/fss_extended.c @@ -867,11 +867,7 @@ extern "C"{ input->start++; } // while - if (input->start > input->stop || input->start >= content.used) { - break; - } - - if (content.string[input->start] == quoted) { + if (content.string[input->start] == quoted || input->start > input->stop || input->start >= content.used) { pre_allocate_size += slash_count + 1; if (pre_allocate_size > buffer->size) { @@ -886,6 +882,10 @@ extern "C"{ slash_count--; } // while + if (input->start > input->stop || input->start >= content.used) { + break; + } + buffer->string[buffer_position.stop] = f_fss_delimit_slash; buffer->string[buffer_position.stop + 1] = quoted; buffer_position.stop += 2; -- 1.8.3.1