From: Kevin Day Date: Tue, 20 Mar 2012 03:14:18 +0000 (-0500) Subject: Update: handle eol when doing writes X-Git-Tag: 0.3.0~61 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=9a28b5e51d6173e51107de1cba45f32b669cbefb;p=fll 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. --- 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++; }