]> Kevux Git Server - fll/commitdiff
Update: handle eol when doing writes
authorKevin Day <kevin@kevux.org>
Tue, 20 Mar 2012 03:14:18 +0000 (22:14 -0500)
committerKevin Day <kevin@kevux.org>
Tue, 20 Mar 2012 03:19:01 +0000 (22:19 -0500)
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

index d4c8610249ea648a21e4c13591fb44897aef51ff..b23835be177ad3bd5df08b8ad1da2cd21cd82eca 100644 (file)
@@ -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++;
       }