From: Kevin Day Date: Fri, 30 Mar 2012 15:40:25 +0000 (-0500) Subject: Bugfix: test for eol during object write X-Git-Tag: 0.3.0~42 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=5c09f14d6030bacc368137965bedde222a7406e7;p=fll Bugfix: test for eol during object write If this is not done, then close quotes could end up being placed after a newline character. --- diff --git a/level_1/fl_fss/c/fss_basic.c b/level_1/fl_fss/c/fss_basic.c index ac4a5b3..c98017e 100644 --- a/level_1/fl_fss/c/fss_basic.c +++ b/level_1/fl_fss/c/fss_basic.c @@ -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]; diff --git a/level_1/fl_fss/c/fss_extended.c b/level_1/fl_fss/c/fss_extended.c index 502f202..c3f10e0 100644 --- a/level_1/fl_fss/c/fss_extended.c +++ b/level_1/fl_fss/c/fss_extended.c @@ -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];