]> Kevux Git Server - fll/commitdiff
Bugfix: Quotes in FSS read functions are not being properly handled and fix backtick...
authorKevin Day <kevin@kevux.org>
Wed, 31 May 2023 04:31:13 +0000 (23:31 -0500)
committerKevin Day <kevin@kevux.org>
Wed, 31 May 2023 04:46:19 +0000 (23:46 -0500)
At some point in time the intended behavior changed from using the literal quote character to an enumeration representing the quote character on FSS read calls.
This transition is incomplete and broken.

Finish the transition, passing the enumeration representation rather than the literal character.

Remove an unnecessary initialization on the quote because the private function being called also initializes the variable.

Relocate the f_uint8s_increase() call to be after changing the error status to ensure that the quotes array is properly incremented.

Update the documentation comments to better clarify this behavior in regards to the enumeration.

There are several FSS read functions that are not handling backticks properly.
The backticks should now be fully and properly processed on read.

14 files changed:
level_0/f_fss/c/fss/common.h
level_0/f_fss/c/fss/quote.h
level_1/fl_fss/c/fss/basic.h
level_1/fl_fss/c/fss/extended.c
level_1/fl_fss/c/fss/extended.h
level_1/fl_fss/c/private-fss.c
level_1/fl_fss/c/private-fss.h
level_2/fll_fss/c/fss/basic.h
level_2/fll_fss/c/fss/extended.h
level_3/fss_basic_read/c/private-print.c
level_3/fss_extended_read/c/private-print.c
level_3/fss_extended_read/c/private-read.c
level_3/fss_payload_read/c/private-print.c
level_3/fss_payload_read/c/private-read.c

index 8417a75fca52ade866be893f2ed5ab7ae39dc0e0..329383d904d5fbb5820158abae4b315559641360 100644 (file)
@@ -20,44 +20,47 @@ extern "C" {
  * FSS-specific types.
  */
 #ifndef _di_f_fss_types_t_
-  #define F_fss_brace_close_s  F_string_ascii_brace_close_s
-  #define F_fss_brace_open_s   F_string_ascii_brace_open_s
-  #define F_fss_colon_s        F_string_ascii_colon_s
-  #define F_fss_minus_s        F_string_ascii_minus_s
-  #define F_fss_f_s            F_string_ascii_f_s
-  #define F_fss_pound_s        F_string_ascii_pound_s
-  #define F_fss_quote_double_s F_string_ascii_quote_double_s
-  #define F_fss_quote_single_s F_string_ascii_quote_single_s
-  #define F_fss_s_s            F_string_ascii_s_s
-  #define F_fss_slash_s        F_string_ascii_slash_backward_s
-  #define F_fss_space_s        F_string_ascii_space_s
-  #define F_fss_underscore_s   F_string_ascii_underscore_s
-
-  #define F_fss_brace_close_s_length  F_string_ascii_brace_close_s_length
-  #define F_fss_brace_open_s_length   F_string_ascii_brace_open_s_length
-  #define F_fss_colon_s_length        F_string_ascii_colon_s_length
-  #define F_fss_minus_s_length        F_string_ascii_minus_s_length
-  #define F_fss_f_s_length            F_string_ascii_f_s_length
-  #define F_fss_pound_s_length        F_string_ascii_pound_s_length
-  #define F_fss_quote_double_s_length F_string_ascii_quote_double_s_length
-  #define F_fss_quote_single_s_length F_string_ascii_quote_single_s_length
-  #define F_fss_s_s_length            F_string_ascii_s_s_length
-  #define F_fss_slash_s_length        F_string_ascii_slash_backward_s_length
-  #define F_fss_space_s_length        F_string_ascii_space_s_length
-  #define F_fss_underscore_s_length   F_string_ascii_underscore_s_length
-
-  #define f_fss_brace_close_s  f_string_ascii_brace_close_s
-  #define f_fss_brace_open_s   f_string_ascii_brace_open_s
-  #define f_fss_colon_s        f_string_ascii_colon_s
-  #define f_fss_minus_s        f_string_ascii_minus_s
-  #define f_fss_f_s            f_string_ascii_f_s
-  #define f_fss_pound_s        f_string_ascii_pound_s
-  #define f_fss_quote_double_s f_string_ascii_quote_double_s
-  #define f_fss_quote_single_s f_string_ascii_quote_single_s
-  #define f_fss_s_s            f_string_ascii_s_s
-  #define f_fss_slash_s        f_string_ascii_slash_backward_s
-  #define f_fss_space_s        f_string_ascii_space_s
-  #define f_fss_underscore_s   f_string_ascii_underscore_s
+  #define F_fss_brace_close_s    F_string_ascii_brace_close_s
+  #define F_fss_brace_open_s     F_string_ascii_brace_open_s
+  #define F_fss_colon_s          F_string_ascii_colon_s
+  #define F_fss_minus_s          F_string_ascii_minus_s
+  #define F_fss_f_s              F_string_ascii_f_s
+  #define F_fss_pound_s          F_string_ascii_pound_s
+  #define F_fss_quote_backtick_s F_string_ascii_grave_s
+  #define F_fss_quote_double_s   F_string_ascii_quote_double_s
+  #define F_fss_quote_single_s   F_string_ascii_quote_single_s
+  #define F_fss_s_s              F_string_ascii_s_s
+  #define F_fss_slash_s          F_string_ascii_slash_backward_s
+  #define F_fss_space_s          F_string_ascii_space_s
+  #define F_fss_underscore_s     F_string_ascii_underscore_s
+
+  #define F_fss_brace_close_s_length    F_string_ascii_brace_close_s_length
+  #define F_fss_brace_open_s_length     F_string_ascii_brace_open_s_length
+  #define F_fss_colon_s_length          F_string_ascii_colon_s_length
+  #define F_fss_minus_s_length          F_string_ascii_minus_s_length
+  #define F_fss_f_s_length              F_string_ascii_f_s_length
+  #define F_fss_pound_s_length          F_string_ascii_pound_s_length
+  #define F_fss_quote_backtick_s_length F_string_ascii_grave_s_length
+  #define F_fss_quote_double_s_length   F_string_ascii_quote_double_s_length
+  #define F_fss_quote_single_s_length   F_string_ascii_quote_single_s_length
+  #define F_fss_s_s_length              F_string_ascii_s_s_length
+  #define F_fss_slash_s_length          F_string_ascii_slash_backward_s_length
+  #define F_fss_space_s_length          F_string_ascii_space_s_length
+  #define F_fss_underscore_s_length     F_string_ascii_underscore_s_length
+
+  #define f_fss_brace_close_s    f_string_ascii_brace_close_s
+  #define f_fss_brace_open_s     f_string_ascii_brace_open_s
+  #define f_fss_colon_s          f_string_ascii_colon_s
+  #define f_fss_minus_s          f_string_ascii_minus_s
+  #define f_fss_f_s              f_string_ascii_f_s
+  #define f_fss_pound_s          f_string_ascii_pound_s
+  #define f_fss_quote_backtick_s f_string_ascii_grave_s
+  #define f_fss_quote_double_s   f_string_ascii_quote_double_s
+  #define f_fss_quote_single_s   f_string_ascii_quote_single_s
+  #define f_fss_s_s              f_string_ascii_s_s
+  #define f_fss_slash_s          f_string_ascii_slash_backward_s
+  #define f_fss_space_s          f_string_ascii_space_s
+  #define f_fss_underscore_s     f_string_ascii_underscore_s
 
   #define f_fss_comment_s                 f_fss_pound_s
   #define f_fss_eol_s                     f_string_eol_s
@@ -97,20 +100,23 @@ extern "C" {
  * FSS-specific delimiters.
  */
 #ifndef _di_f_fss_delimiters_
-  #define F_fss_delimit_placeholder_s  F_string_placeholder_s
-  #define F_fss_delimit_quote_single_s F_fss_quote_single_s
-  #define F_fss_delimit_quote_double_s F_fss_quote_double_s
-  #define F_fss_delimit_slash_s        F_fss_slash_s
-
-  #define F_fss_delimit_placeholder_s_length  F_string_placeholder_s_length
-  #define F_fss_delimit_quote_single_s_length F_fss_quote_single_s_length
-  #define F_fss_delimit_quote_double_s_length F_fss_quote_double_s_length
-  #define F_fss_delimit_slash_s_length        F_fss_slash_s_length
-
-  #define f_fss_delimit_placeholder_s  f_string_placeholder_s
-  #define f_fss_delimit_quote_single_s f_fss_quote_single_s
-  #define f_fss_delimit_quote_double_s f_fss_quote_double_s
-  #define f_fss_delimit_slash_s        f_fss_slash_s
+  #define F_fss_delimit_placeholder_s    F_string_placeholder_s
+  #define F_fss_delimit_quote_backtick_s F_fss_quote_backtick_s
+  #define F_fss_delimit_quote_double_s   F_fss_quote_double_s
+  #define F_fss_delimit_quote_single_s   F_fss_quote_single_s
+  #define F_fss_delimit_slash_s          F_fss_slash_s
+
+  #define F_fss_delimit_placeholder_s_length    F_string_placeholder_s_length
+  #define F_fss_delimit_quote_backtick_s_length F_fss_quote_backtick_s_length
+  #define F_fss_delimit_quote_double_s_length   F_fss_quote_double_s_length
+  #define F_fss_delimit_quote_single_s_length   F_fss_quote_single_s_length
+  #define F_fss_delimit_slash_s_length          F_fss_slash_s_length
+
+  #define f_fss_delimit_placeholder_s    f_string_placeholder_s
+  #define f_fss_delimit_quote_backtick_s f_fss_quote_backtick_s
+  #define f_fss_delimit_quote_double_s   f_fss_quote_double_s
+  #define f_fss_delimit_quote_single_s   f_fss_quote_single_s
+  #define f_fss_delimit_slash_s          f_fss_slash_s
 #endif //_di_f_fss_delimiters_
 
 /**
index a8123f179a0c053438c46d4e1fee3339310dd33f..eff8d920c0459ed4900d6cf5c0732bf11b79c95b 100644 (file)
@@ -20,15 +20,17 @@ extern "C" {
  * Types for FSS quote.
  *
  * f_fss_quote_type_*:
- *   - none:   Not a quote.
- *   - single: Quote type is a single quote.
- *   - double: Quote type is a double quote.
+ *   - none:     Not a quote.
+ *   - single:   Quote type is a single quote.
+ *   - double:   Quote type is a double quote.
+ *   - backtick: Quote type is a backtick.
  */
 #ifndef _di_f_fss_quote_type_
   enum {
     f_fss_quote_type_none_e = 0,
     f_fss_quote_type_single_e,
     f_fss_quote_type_double_e,
+    f_fss_quote_type_backtick_e,
   };
 #endif // _di_f_fss_quote_type_
 
index 123c61f966ac6845c84dda384109844a56cad280..c0e14a525facee147341bf0959c961fb5ffba75a 100644 (file)
@@ -158,7 +158,7 @@ extern "C" {
  * @param found
  *   A location where a valid object was found.
  * @param quote
- *   This will store whether or not this object is quote and what quote is in use.
+ *   This will store the quote type representing the character to use (from the f_fss_quote_type_*_e).
  *   Set pointer address to 0 to not use.
  * @param delimits
  *   A delimits array representing where delimits exist within the buffer.
index 81193e7cefd2e951edeb8ac1701d2326da754d09..3b71ea1b9837297538919d82820ebfc649706acd 100644 (file)
@@ -39,22 +39,20 @@ extern "C" {
 
       f_string_range_t content_partial = f_string_range_t_initialize;
 
-      quote = f_fss_quote_type_none_e;
-
       status = private_fl_fss_basic_read(buffer, F_false, state, range, &content_partial, &quote, delimits);
 
       if (status == F_fss_found_object || F_status_set_fine(status) == F_fss_found_object_content_not) {
         status_allocate = f_string_ranges_increase(state.step_small, found);
 
-        if (F_status_is_error_not(status_allocate) && quotes) {
-          status_allocate = f_uint8s_increase(state.step_small, quotes);
-        }
-
         // The private function sets the error bit on unterminated quoted Object.
         if (status == F_status_set_error(F_fss_found_object_content_not)) {
           status = F_fss_found_object_content_not;
         }
 
+        if (F_status_is_error_not(status_allocate) && quotes) {
+          status_allocate = f_uint8s_increase(state.step_small, quotes);
+        }
+
         if (F_status_is_error(status_allocate)) {
           delimits->used = delimits_used;
 
@@ -68,17 +66,7 @@ extern "C" {
         found->array[found->used++] = content_partial;
 
         if (quotes) {
-          if (quote == f_fss_quote_type_double_e) {
-            quotes->array[quotes->used] = f_string_ascii_quote_double_s.string[0];
-          }
-          else if (quote == f_fss_quote_type_single_e) {
-            quotes->array[quotes->used] = f_string_ascii_quote_single_s.string[0];
-          }
-          else {
-            quotes->array[quotes->used] = 0;
-          }
-
-          quotes->used = found->used;
+          quotes->array[quotes->used++] = quote;
         }
 
         content_found = 1;
@@ -116,6 +104,10 @@ extern "C" {
       else if (F_status_is_error(status)) {
         delimits->used = delimits_used;
 
+        if (quotes) {
+          quotes->used = quotes_used;
+        }
+
         return status;
       }
     } // while
index c407fbc8a52343477025bd2827c6aa1f96f81745..f8edcba63389984ee692d2cd2b50b1505e1ee01f 100644 (file)
@@ -53,7 +53,7 @@ extern "C" {
  * @param found
  *   A set of all locations where a valid content was found.
  * @param quotes
- *   An array of quotes designating whether or not content is quoted and what quote is in use.
+ *   This will store the quote types representing the character to use (from the f_fss_quote_type_*_e).
  *   Set pointer address to 0 to not use.
  * @param delimits
  *   A delimits array representing where delimits exist within the buffer.
@@ -185,7 +185,7 @@ extern "C" {
  * @param found
  *   A location where a valid object was found.
  * @param quoted
- *   This will store whether or not this object is quoted and what quote is in use.
+ *   This will store the quote type representing the character to use (from the f_fss_quote_type_*_e).
  *   Set pointer address to 0 to not use.
  * @param delimits
  *   A delimits array representing where delimits exist within the buffer.
index c2dd4893b7cd81c5cfb6e2b0f653f92b1e645e92..a117e4926e8f20f4d005743a5d394370ec0681f8 100644 (file)
@@ -253,7 +253,7 @@ extern "C" {
         return F_none_stop;
       }
 
-      if (buffer.string[range->start] == f_fss_delimit_quote_single_s.string[0] || buffer.string[range->start] == f_fss_delimit_quote_double_s.string[0] || (object_as && buffer.string[range->start] == f_fss_comment_s.string[0])) {
+      if (buffer.string[range->start] == f_fss_quote_single_s.string[0] || buffer.string[range->start] == f_fss_quote_double_s.string[0] || buffer.string[range->start] == f_fss_quote_backtick_s.string[0] || (object_as && buffer.string[range->start] == f_fss_comment_s.string[0])) {
 
         // Only the first slash before a quote needs to be escaped (or not) as once there is a slash before a quote, this cannot ever be a quote object.
         // This simplifies the number of slashes needed.
@@ -266,7 +266,7 @@ extern "C" {
         if (F_status_is_error(status)) return status;
       }
     }
-    else if (buffer.string[range->start] == f_fss_delimit_quote_single_s.string[0] || buffer.string[range->start] == f_fss_delimit_quote_double_s.string[0]) {
+    else if (buffer.string[range->start] == f_fss_quote_single_s.string[0] || buffer.string[range->start] == f_fss_delimit_quote_double_s.string[0] || buffer.string[range->start] == f_fss_quote_backtick_s.string[0]) {
       quote_found = buffer.string[range->start];
 
       status = f_utf_buffer_increment(buffer, range, 1);
@@ -366,11 +366,14 @@ extern "C" {
 
             if (status == F_true) {
               if (quote) {
-                if (quote_found == f_fss_delimit_quote_single_s.string[0]) {
+                if (quote_found == f_fss_quote_double_s.string[0]) {
+                  *quote = f_fss_quote_type_double_e;
+                }
+                else if (quote_found == f_fss_quote_single_s.string[0]) {
                   *quote = f_fss_quote_type_single_e;
                 }
-                else if (quote_found == f_fss_delimit_quote_double_s.string[0]) {
-                  *quote = f_fss_quote_type_double_e;
+                else if (quote_found == f_fss_quote_backtick_s.string[0]) {
+                  *quote = f_fss_quote_type_backtick_e;
                 }
                 else {
                   *quote = f_fss_quote_type_none_e;
@@ -526,11 +529,14 @@ extern "C" {
 
           if (status == F_true) {
             if (quote) {
-              if (quote_found == f_fss_delimit_quote_single_s.string[0]) {
+              if (quote_found == f_fss_quote_double_s.string[0]) {
+                *quote = f_fss_quote_type_double_e;
+              }
+              else if (quote_found == f_fss_quote_single_s.string[0]) {
                 *quote = f_fss_quote_type_single_e;
               }
-              else if (quote_found == f_fss_delimit_quote_double_s.string[0]) {
-                *quote = f_fss_quote_type_double_e;
+              else if (quote_found == f_fss_quote_backtick_s.string[0]) {
+                *quote = f_fss_quote_type_backtick_e;
               }
               else {
                 *quote = f_fss_quote_type_none_e;
index d44128fef085b1cd54122fbf4b2235a90addd40d..4ab48eb0de1ca7b528fe0182b75b5eb0afa36c69 100644 (file)
@@ -112,7 +112,7 @@ extern "C" {
  * @param found
  *   A set of all locations where a valid object was found.
  * @param quote
- *   This will store whether or not this object is quote and what quote is in use.
+ *   This will store the quote type representing the character to use (from the f_fss_quote_type_*_e).
  *   Set pointer address to 0 to not use.
  * @param delimits
  *   An array of delimits detected during processing.
index d4043430cb3ec858685ef3741239ffebe169cc73..7cd7bc9b42b848e3c7b2ac5c6e876affdab38ba8 100644 (file)
@@ -48,7 +48,7 @@ extern "C" {
  * @param contents
  *   This will be populated with all valid contents found.
  * @param objects_quoted
- *   (optional) An array mapped to each object in objects representing the quote discovered, if any.
+ *   (optional) An array mapped to each object in objects representing the quote type discovered (from the f_fss_quote_type_*_e), if any.
  *   Set the pointer address to 0 to disable.
  * @param objects_delimits
  *   An array of delimits for objects detected during processing.
index 6dcf9394de74fa308e27855e673000e35ae08b95..33ca87654fcdba6912c4e7bae9b8d7c6dac115e8 100644 (file)
@@ -47,10 +47,10 @@ extern "C" {
  * @param contents
  *   This will be populated with all valid contents found.
  * @param objects_quoted
- *   (optional) An array mapped to each object in objects representing the quote discovered, if any.
+ *   (optional) An array mapped to each object in objects representing the quote type discovered (from the f_fss_quote_type_*_e), if any.
  *   Set the pointer address to 0 to disable.
  * @param contents_quoted
- *   (optional) An array mapped to each content in contents representing the quote discovered, if any.
+ *   (optional) An array mapped to each content in objects representing the quote type discovered (from the f_fss_quote_type_*_e), if any.
  *   Set the pointer address to 0 to disable.
  * @param objects_delimits
  *   An array of delimits for objects detected during processing.
index 56cac0d0735dee645abd924023e17aff3037cba8..f8c8a60e001a350e456bf0b268ef1304a1af5808 100644 (file)
@@ -20,13 +20,27 @@ extern "C" {
         if (data->option & fss_basic_read_data_option_trim_d) {
           if (data->option & fss_basic_read_data_option_original_d) {
             if (data->quotes.array[at]) {
-              f_print_dynamic_raw(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+              f_print_dynamic_raw(
+                data->quotes.array[at] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s
+                  : data->quotes.array[at] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s
+                    : f_fss_quote_backtick_s,
+                main->output.to.stream
+              );
             }
 
             fl_print_trim_dynamic_partial(data->buffer, data->objects.array[at], main->output.to.stream);
 
             if (data->quotes.array[at]) {
-              f_print_dynamic_raw(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+              f_print_dynamic_raw(
+                data->quotes.array[at] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s
+                  : data->quotes.array[at] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s
+                    : f_fss_quote_backtick_s,
+                main->output.to.stream
+              );
             }
           }
           else {
@@ -36,13 +50,27 @@ extern "C" {
         else {
           if (data->option & fss_basic_read_data_option_original_d) {
             if (data->quotes.array[at]) {
-              f_print_dynamic_raw(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+              f_print_dynamic_raw(
+                data->quotes.array[at] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s
+                  : data->quotes.array[at] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s
+                    : f_fss_quote_backtick_s,
+                main->output.to.stream
+              );
             }
 
             f_print_dynamic_partial(data->buffer, data->objects.array[at], main->output.to.stream);
 
             if (data->quotes.array[at]) {
-              f_print_dynamic_raw(data->quotes.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+              f_print_dynamic_raw(
+                data->quotes.array[at] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s
+                  : data->quotes.array[at] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s
+                    : f_fss_quote_backtick_s,
+                main->output.to.stream
+              );
             }
           }
           else {
index f318c566d434e329a43a8788baba2597ed08ddf2..f94030d7502a24627d6623c2eb16122e3bb3e0f2 100644 (file)
@@ -20,24 +20,52 @@ extern "C" {
       if (data->option & fss_extended_read_data_option_object_d) {
         if (data->option & fss_extended_read_data_option_trim_d) {
           if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_object.array[at]) {
-            f_print_dynamic_raw(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+            f_print_dynamic_raw(
+              data->quotes_object.array[at] == f_fss_quote_type_single_e
+                ? f_fss_quote_single_s
+                : data->quotes_object.array[at] == f_fss_quote_type_double_e
+                  ? f_fss_quote_double_s
+                  : f_fss_quote_backtick_s,
+              main->output.to.stream
+            );
           }
 
           fl_print_trim_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to.stream);
 
           if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_object.array[at]) {
-            f_print_dynamic_raw(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+            f_print_dynamic_raw(
+              data->quotes_object.array[at] == f_fss_quote_type_single_e
+                ? f_fss_quote_single_s
+                : data->quotes_object.array[at] == f_fss_quote_type_double_e
+                  ? f_fss_quote_double_s
+                  : f_fss_quote_backtick_s,
+              main->output.to.stream
+            );
           }
         }
         else {
           if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_object.array[at]) {
-            f_print_dynamic_raw(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+            f_print_dynamic_raw(
+              data->quotes_object.array[at] == f_fss_quote_type_single_e
+                ? f_fss_quote_single_s
+                : data->quotes_object.array[at] == f_fss_quote_type_double_e
+                  ? f_fss_quote_double_s
+                  : f_fss_quote_backtick_s,
+              main->output.to.stream
+            );
           }
 
           f_print_except_dynamic_partial(data->buffer, data->objects.array[at], delimits_object, main->output.to.stream);
 
           if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_object.array[at]) {
-            f_print_dynamic_raw(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+            f_print_dynamic_raw(
+              data->quotes_object.array[at] == f_fss_quote_type_single_e
+                ? f_fss_quote_single_s
+                : data->quotes_object.array[at] == f_fss_quote_type_double_e
+                  ? f_fss_quote_double_s
+                  : f_fss_quote_backtick_s,
+              main->output.to.stream
+            );
           }
         }
 
@@ -54,13 +82,27 @@ extern "C" {
             content_printed = F_true;
 
             if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[data->select]) {
-              f_print_dynamic_raw(data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+              f_print_dynamic_raw(
+                data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s
+                  : data->quotes_content.array[at].array[data->select] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s
+                    : f_fss_quote_backtick_s,
+                main->output.to.stream
+              );
             }
 
             f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[data->select], delimits_content, main->output.to.stream);
 
             if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[data->select]) {
-              f_print_dynamic_raw(data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+              f_print_dynamic_raw(
+                data->quotes_content.array[at].array[data->select] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s
+                  : data->quotes_content.array[at].array[data->select] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s
+                    : f_fss_quote_backtick_s,
+                main->output.to.stream
+              );
             }
           }
         }
@@ -74,13 +116,27 @@ extern "C" {
             content_printed = F_true;
 
             if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[i]) {
-              f_print_dynamic_raw(data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+              f_print_dynamic_raw(
+                data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s
+                  : data->quotes_content.array[at].array[i] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s
+                    : f_fss_quote_backtick_s,
+                main->output.to.stream
+              );
             }
 
             f_print_except_dynamic_partial(data->buffer, data->contents.array[at].array[i], delimits_content, main->output.to.stream);
 
             if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[i]) {
-              f_print_dynamic_raw(data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+              f_print_dynamic_raw(
+                data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s
+                  : data->quotes_content.array[at].array[i] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s
+                    : f_fss_quote_backtick_s,
+                main->output.to.stream
+              );
             }
 
             if (i + 1 < data->contents.array[at].used && data->contents.array[at].array[i + 1].start <= data->contents.array[at].array[i + 1].stop) {
index f304972cfe564ded31a824a3cb1bb6ed65f79ecf..fc177850cc90c75198193502d0762fb2a5763217 100644 (file)
@@ -406,13 +406,27 @@ extern "C" {
           }
           else {
             if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_object.array[at]) {
-              f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+              f_print_character_safely(
+                data->quotes_object.array[at] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s.string[0]
+                  : data->quotes_object.array[at] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s.string[0]
+                    : f_fss_quote_backtick_s.string[0],
+                main->output.to.stream
+              );
             }
 
             fss_extended_read_print_at(main, i, *delimits_object, *delimits_content, data);
 
             if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_object.array[at]) {
-              f_print_character_safely(data->quotes_object.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+              f_print_character_safely(
+                data->quotes_object.array[at] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s.string[0]
+                  : data->quotes_object.array[at] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s.string[0]
+                    : f_fss_quote_backtick_s.string[0],
+                main->output.to.stream
+              );
             }
           }
         }
@@ -426,13 +440,27 @@ extern "C" {
         }
         else {
           if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[i]) {
-            f_print_character_safely(data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+            f_print_character_safely(
+              data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e
+                ? f_fss_quote_single_s.string[0]
+                : data->quotes_content.array[at].array[i] == f_fss_quote_type_double_e
+                  ? f_fss_quote_double_s.string[0]
+                  : f_fss_quote_backtick_s.string[0],
+              main->output.to.stream
+            );
           }
 
           fss_extended_read_print_at(main, i, *delimits_object, *delimits_content, data);
 
           if ((data->option & fss_extended_read_data_option_original_d) && data->quotes_content.array[at].array[i]) {
-            f_print_character_safely(data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+            f_print_character_safely(
+              data->quotes_content.array[at].array[i] == f_fss_quote_type_single_e
+                ? f_fss_quote_single_s.string[0]
+                : data->quotes_content.array[at].array[i] == f_fss_quote_type_double_e
+                  ? f_fss_quote_double_s.string[0]
+                  : f_fss_quote_backtick_s.string[0],
+              main->output.to.stream
+            );
           }
         }
 
index db7a4599d5b0138aaf5b22ce099059d2ab9b1c19..c52877043285b34bc8b85dfb536d97b3ac90929b 100644 (file)
@@ -68,24 +68,52 @@ extern "C" {
       if (data->option & fss_payload_read_data_option_object_d) {
         if (data->option & fss_payload_read_data_option_trim_d) {
           if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_object_header.array[at]) {
-            f_print_dynamic_raw(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+            f_print_dynamic_raw(
+              data->quotes_object_header.array[at] == f_fss_quote_type_single_e
+                ? f_fss_quote_single_s
+                : data->quotes_object_header.array[at] == f_fss_quote_type_double_e
+                  ? f_fss_quote_double_s
+                  : f_fss_quote_backtick_s,
+              main->output.to.stream
+            );
           }
 
           fl_print_trim_except_dynamic_partial(data->buffer, data->objects_header.array[at], delimits_object, main->output.to.stream);
 
           if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_object_header.array[at]) {
-            f_print_dynamic_raw(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+            f_print_dynamic_raw(
+              data->quotes_object_header.array[at] == f_fss_quote_type_single_e
+                ? f_fss_quote_single_s
+                : data->quotes_object_header.array[at] == f_fss_quote_type_double_e
+                  ? f_fss_quote_double_s
+                  : f_fss_quote_backtick_s,
+              main->output.to.stream
+            );
           }
         }
         else {
           if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_object_header.array[at]) {
-            f_print_dynamic_raw(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+            f_print_dynamic_raw(
+              data->quotes_object_header.array[at] == f_fss_quote_type_single_e
+                ? f_fss_quote_single_s
+                : data->quotes_object_header.array[at] == f_fss_quote_type_double_e
+                  ? f_fss_quote_double_s
+                  : f_fss_quote_backtick_s,
+              main->output.to.stream
+            );
           }
 
           f_print_except_dynamic_partial(data->buffer, data->objects_header.array[at], delimits_object, main->output.to.stream);
 
           if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_object_header.array[at]) {
-            f_print_dynamic_raw(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+            f_print_dynamic_raw(
+              data->quotes_object_header.array[at] == f_fss_quote_type_single_e
+                ? f_fss_quote_single_s
+                : data->quotes_object_header.array[at] == f_fss_quote_type_double_e
+                  ? f_fss_quote_double_s
+                  : f_fss_quote_backtick_s,
+              main->output.to.stream
+            );
           }
         }
 
@@ -102,13 +130,27 @@ extern "C" {
             content_printed = F_true;
 
             if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_content_header.array[at].array[data->select]) {
-              f_print_dynamic_raw(data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+              f_print_dynamic_raw(
+                data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s
+                  : data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s
+                    : f_fss_quote_backtick_s,
+                main->output.to.stream
+              );
             }
 
             f_print_except_dynamic_partial(data->buffer, data->contents_header.array[at].array[data->select], delimits_content, main->output.to.stream);
 
             if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_content_header.array[at].array[data->select]) {
-              f_print_dynamic_raw(data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+              f_print_dynamic_raw(
+                data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s
+                  : data->quotes_content_header.array[at].array[data->select] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s
+                    : f_fss_quote_backtick_s,
+                main->output.to.stream
+              );
             }
           }
         }
@@ -122,13 +164,27 @@ extern "C" {
             content_printed = F_true;
 
             if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_content_header.array[at].array[i]) {
-              f_print_dynamic_raw(data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+              f_print_dynamic_raw(
+                data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s
+                  : data->quotes_content_header.array[at].array[i] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s
+                    : f_fss_quote_backtick_s,
+                main->output.to.stream
+              );
             }
 
             f_print_except_dynamic_partial(data->buffer, data->contents_header.array[at].array[i], delimits_content, main->output.to.stream);
 
             if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_content_header.array[at].array[i]) {
-              f_print_dynamic_raw(data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s : f_fss_quote_double_s, main->output.to.stream);
+              f_print_dynamic_raw(
+                data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s
+                  : data->quotes_content_header.array[at].array[i] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s
+                    : f_fss_quote_backtick_s,
+                main->output.to.stream
+              );
             }
 
             if (i + 1 < data->contents_header.array[at].used && data->contents_header.array[at].array[i + 1].start <= data->contents_header.array[at].array[i + 1].stop) {
index d930469922b5181100d87f279966bbc038f54088..099f1cecdfd62f1fc6122427847ef35e21c465bf 100644 (file)
@@ -609,13 +609,27 @@ extern "C" {
           }
           else {
             if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_object_header.array[at]) {
-              f_print_character_safely(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+              f_print_character_safely(
+                data->quotes_object_header.array[at] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s.string[0]
+                  : data->quotes_object_header.array[at] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s.string[0]
+                    : f_fss_quote_backtick_s.string[0],
+                main->output.to.stream
+              );
             }
 
             fss_payload_read_print_at_extended(main, i, *delimits_object, *delimits_content, data);
 
             if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_object_header.array[at]) {
-              f_print_character_safely(data->quotes_object_header.array[at] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+              f_print_character_safely(
+                data->quotes_object_header.array[at] == f_fss_quote_type_single_e
+                  ? f_fss_quote_single_s.string[0]
+                  : data->quotes_object_header.array[at] == f_fss_quote_type_double_e
+                    ? f_fss_quote_double_s.string[0]
+                    : f_fss_quote_backtick_s.string[0],
+                main->output.to.stream
+              );
             }
           }
         }
@@ -629,13 +643,27 @@ extern "C" {
         }
         else {
           if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_content_header.array[at].array[i]) {
-            f_print_character_safely(data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+            f_print_character_safely(
+              data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e
+                ? f_fss_quote_single_s.string[0]
+                : data->quotes_content_header.array[at].array[i] == f_fss_quote_type_double_e
+                  ? f_fss_quote_double_s.string[0]
+                  : f_fss_quote_backtick_s.string[0],
+              main->output.to.stream
+            );
           }
 
           fss_payload_read_print_at_extended(main, i, *delimits_object, *delimits_content, data);
 
           if ((data->option & fss_payload_read_data_option_original_d) && data->quotes_content_header.array[at].array[i]) {
-            f_print_character_safely(data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e ? f_fss_quote_single_s.string[0] : f_fss_quote_double_s.string[0], main->output.to.stream);
+            f_print_character_safely(
+              data->quotes_content_header.array[at].array[i] == f_fss_quote_type_single_e
+                ? f_fss_quote_single_s.string[0]
+                : data->quotes_content_header.array[at].array[i] == f_fss_quote_type_double_e
+                  ? f_fss_quote_double_s.string[0]
+                  : f_fss_quote_backtick_s.string[0],
+              main->output.to.stream
+            );
           }
         }