]> Kevux Git Server - fll/commitdiff
Bugfix: FSS Extended Write is incorrectly adding a delimit slash for the first quote...
authorKevin Day <kevin@kevux.org>
Sun, 3 Mar 2024 05:13:02 +0000 (23:13 -0600)
committerKevin Day <kevin@kevux.org>
Sun, 3 Mar 2024 05:31:52 +0000 (23:31 -0600)
If the first character in the string is a quote, then a delimit slash only needs to be added when there is a space after the quote.
If there is a graph character after the quote, then the delimit slash is not needed.

level_1/fl_fss/c/private-fss.c

index c07423af9e3cb3fada5ceb744118990e91eac2ef..841bc0aa37a1bb8c2eae14b4431a950162a0ca0f 100644 (file)
@@ -806,7 +806,7 @@ extern "C" {
     destination->string[destination->used++] = f_fss_placeholder_s.string[0];
     destination->string[destination->used++] = f_fss_placeholder_s.string[0];
 
-    // If there is an initial quote, then this must be quote and the existing quote must be delimited.
+    // If there is an initial quote, then this must be escaped.
     if (object.string[input_start] == quote_char) {
       quoted_is = F_true;
     }
@@ -992,14 +992,6 @@ extern "C" {
       else if (object.string[range->start] == quote_char) {
         item_first = range->start++;
 
-        // The very first quote, must be escaped, when quoting is disabled.
-        if (item_first == input_start) {
-          state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size);
-          if (F_status_is_error(state->status)) break;
-
-          destination->string[used_start + 1] = f_fss_slash_s.string[0];
-        }
-
         f_fss_skip_past_delimit(object, range, state);
         if (F_status_is_error(state->status)) return;
 
@@ -1034,12 +1026,10 @@ extern "C" {
             break;
           }
 
-          if (item_first != input_start) {
-            state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size);
-            if (F_status_is_error(state->status)) break;
+          state->status = f_memory_array_increase(state->step_large, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size);
+          if (F_status_is_error(state->status)) break;
 
-            destination->string[destination->used++] = f_fss_slash_s.string[0];
-          }
+          destination->string[destination->used++] = f_fss_slash_s.string[0];
 
           quoted_is = F_true;
         }