From 318743a54e39bd02a4acad8c175cde24fc1f4b68 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 5 Mar 2024 20:52:16 -0600 Subject: [PATCH] Bugfix: FSS Extended Write is not properly quoting quotes. When writing using a quote character that is not the selected quote to use when writing, these other quote character must still be quoted. Take for example this: # fss_extended_write -oc "'" '"' -oc '"' "'" -oc ' `' "\` " -oc "'" "'" "'" "\"" "\"" "'" "`" "` " "'" "'" Quoting the quotes is necessary to ensure that the FSS Extended Read properly works. Otherwise the [' '] would be read as an Object without Content when instead the code should be ["'" "'"] which would be read as an Object of ' and a Content of '. --- level_1/fl_fss/c/private-fss.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/level_1/fl_fss/c/private-fss.c b/level_1/fl_fss/c/private-fss.c index 506e0f0..9739cbd 100644 --- a/level_1/fl_fss/c/private-fss.c +++ b/level_1/fl_fss/c/private-fss.c @@ -1042,6 +1042,30 @@ extern "C" { } else if (object.string[range->start] != f_fss_delimit_placeholder_s.string[0]) { if (!quote_is) { + if (object.string[range->start] == f_string_ascii_quote_double_s.string[0] || object.string[range->start] == f_string_ascii_quote_single_s.string[0] || object.string[range->start] == f_string_ascii_grave_s.string[0]) { + item_first = range->start++; + + status = f_fss_skip_past_delimit(state, object, range); + if (F_status_is_error(status)) return status; + + if (range->start > range->stop || range->start >= object.used) { + quote_is = F_true; + } + else if (object.string[range->start] == object.string[item_first]) { + quote_is = F_true; + } + else { + status = f_fss_is_space(state, object, *range); + if (F_status_is_error(status)) break; + + if (status == F_true) { + quote_is = F_true; + } + } + + range->start = item_first; + } + status = f_fss_is_space(state, object, *range); if (F_status_is_error(status)) break; -- 1.8.3.1