]> Kevux Git Server - fll/commitdiff
Bugfix: test for eol during object write
authorKevin Day <kevin@kevux.org>
Fri, 30 Mar 2012 15:40:25 +0000 (10:40 -0500)
committerKevin Day <kevin@kevux.org>
Fri, 30 Mar 2012 15:40:25 +0000 (10:40 -0500)
If this is not done, then close quotes could end up being placed after a newline character.

level_1/fl_fss/c/fss_basic.c
level_1/fl_fss/c/fss_extended.c

index ac4a5b3daf9d2d8aba3d833fa08c22a48de021b1..c98017e86141cf6ebf042a71e38da28340ef0261 100644 (file)
@@ -355,6 +355,16 @@ extern "C"{
       if (object.string[input->start] == f_fss_delimit_placeholder) {
         input->start++;
         continue;
+      } else if (object.string[input->start] == f_eol) {
+        if (quoted) {
+          buffer->string[buffer_position.stop] = f_fss_delimit_double_quote;
+          buffer_position.stop++;
+        }
+
+        buffer->string[buffer_position.stop] = f_fss_basic_open;
+        buffer->used = buffer_position.stop + 1;
+
+        return f_none_on_eol;
       } else if (isspace(object.string[input->start]) || quoted) {
         pre_allocate_size++;
 
@@ -424,6 +434,14 @@ extern "C"{
             } // while
 
             continue;
+          } else if (object.string[input->start] == f_eol) {
+            buffer->string[buffer_position.stop] = f_fss_delimit_double_quote;
+            buffer_position.stop++;
+
+            buffer->string[buffer_position.stop] = f_fss_basic_open;
+            buffer->used = buffer_position.stop + 1;
+
+            return f_none_on_eol;
           }
 
           buffer->string[buffer_position.stop] = object.string[input->start];
index 502f20203f5124a4230a3898ffd573b44c8c3cd3..c3f10e0713afad37e7e691cd7f99dbe707dba077 100644 (file)
@@ -581,6 +581,16 @@ extern "C"{
       if (object.string[input->start] == f_fss_delimit_placeholder) {
         input->start++;
         continue;
+      } else if (object.string[input->start] == f_eol) {
+        if (quoted) {
+          buffer->string[buffer_position.stop] = f_fss_delimit_double_quote;
+          buffer_position.stop++;
+        }
+
+        buffer->string[buffer_position.stop] = f_fss_basic_open;
+        buffer->used = buffer_position.stop + 1;
+
+        return f_none_on_eol;
       } else if (isspace(object.string[input->start]) || quoted) {
         f_string_length first_space = input->start;
 
@@ -666,6 +676,14 @@ extern "C"{
             } // while
 
             continue;
+          } else if (object.string[input->start] == f_eol) {
+            buffer->string[buffer_position.stop] = f_fss_delimit_double_quote;
+            buffer_position.stop++;
+
+            buffer->string[buffer_position.stop] = f_fss_basic_open;
+            buffer->used = buffer_position.stop + 1;
+
+            return f_none_on_eol;
           }
 
           buffer->string[buffer_position.stop] = object.string[input->start];