From 9a28b5e51d6173e51107de1cba45f32b669cbefb Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 19 Mar 2012 22:14:18 -0500 Subject: [PATCH] Update: handle eol when doing writes If the buffer being read from contains an eol, then do not process any further. This prevents writing newlines without ignoring them entirely. This returns f_none_on_eol, which does not exist yet. A commit following this one will add the eol return codes. --- level_1/fl_fss/c/fss_basic.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/level_1/fl_fss/c/fss_basic.c b/level_1/fl_fss/c/fss_basic.c index d4c8610..b23835b 100644 --- a/level_1/fl_fss/c/fss_basic.c +++ b/level_1/fl_fss/c/fss_basic.c @@ -479,7 +479,13 @@ extern "C"{ } while (input->start <= input->stop && input->start < buffer.used) { - if (buffer.string[input->start] != f_eol && buffer.string[input->start] != f_fss_delimit_placeholder) { + if (buffer.string[input->start] == f_eol){ + content->string[content_position.stop] = f_eol; + content->used = content_position.stop + 1; + return f_none_on_eos; + } + + if (buffer.string[input->start] != f_fss_delimit_placeholder) { content->string[content_position.stop] = buffer.string[input->start]; content_position.stop++; } -- 1.8.3.1