From: Kevin Day Date: Wed, 6 Mar 2024 02:52:16 +0000 (-0600) Subject: Bugfix: FSS Extended Write is not properly quoting quotes. X-Git-Tag: 0.6.10~22 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=318743a54e39bd02a4acad8c175cde24fc1f4b68;p=fll 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 '. --- 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;