]> Kevux Git Server - fll/commitdiff
Bugfix: be sure to delimit trailing \ if it is an the end of a quoted content
authorKevin Day <kevin@kevux.org>
Sat, 31 Mar 2012 20:19:34 +0000 (15:19 -0500)
committerKevin Day <kevin@kevux.org>
Sat, 31 Mar 2012 20:19:34 +0000 (15:19 -0500)
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

index c3f10e0713afad37e7e691cd7f99dbe707dba077..56b49700108c0162285426c411c695fcec55af28 100644 (file)
@@ -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;