From 0ddca96deeff1d709ec5313aba9b263d42af9466 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 25 Mar 2012 19:20:48 -0500 Subject: [PATCH] Update: return stop points even when no object/content is found This makes a things a little more consistent. If an object was not found, then the code would seek to the end of line or a stop point. Prior to this patch, after doing the sleep, the appropriate object/content not found is returned when a stop point was reached. Now, the appropriate no_data or none stop point return value is used in such a case. --- level_1/fl_fss/c/fss_basic.c | 8 +++++++- level_1/fl_fss/c/fss_extended.c | 18 +++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/level_1/fl_fss/c/fss_basic.c b/level_1/fl_fss/c/fss_basic.c index 7e809bd..8359e15 100644 --- a/level_1/fl_fss/c/fss_basic.c +++ b/level_1/fl_fss/c/fss_basic.c @@ -149,6 +149,8 @@ extern "C"{ input->start++; } // while + fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop) + input->start++; return fl_fss_found_no_object; } else if (buffer->string[input->start] == f_eol) { @@ -193,6 +195,8 @@ extern "C"{ input->start++; } // while + fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop) + input->start++; return fl_fss_found_no_object; } @@ -215,7 +219,9 @@ extern "C"{ // seek to the end of the line when no valid object is found while (input->start < buffer->used && input->start <= input->stop && buffer->string[input->start] != f_eol) { input->start++; - } + } // while + + fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop) input->start++; return fl_fss_found_no_object; diff --git a/level_1/fl_fss/c/fss_extended.c b/level_1/fl_fss/c/fss_extended.c index aef7463..ea05a8f 100644 --- a/level_1/fl_fss/c/fss_extended.c +++ b/level_1/fl_fss/c/fss_extended.c @@ -149,6 +149,8 @@ extern "C"{ input->start++; } // while + fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop) + input->start++; return fl_fss_found_no_object; } else if (buffer->string[input->start] == f_eol) { @@ -193,12 +195,14 @@ extern "C"{ input->start++; } // while + fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop) + input->start++; return fl_fss_found_no_object; } input->start++; - } + } // while fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop) } else if (buffer->string[input->start] == f_eol) { @@ -215,7 +219,9 @@ extern "C"{ // seek to the end of the line when no valid object is found while (input->start < buffer->used && input->start <= input->stop && buffer->string[input->start] != f_eol) { input->start++; - } + } // while + + fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_no_data_on_eos, f_no_data_on_stop) input->start++; return fl_fss_found_no_object; @@ -378,6 +384,8 @@ extern "C"{ input->start++; } // while + fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_unterminated_group_on_eos, f_unterminated_group_on_stop) + input->start++; return f_unterminated_group; } else if (buffer->string[input->start] == f_eol) { @@ -428,6 +436,8 @@ extern "C"{ input->start++; } // while + fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_unterminated_group_on_eos, f_unterminated_group_on_stop) + input->start++; return f_unterminated_group; } @@ -473,7 +483,9 @@ extern "C"{ // seek to the end of the line when no valid content is found while (input->start < buffer->used && input->start <= input->stop && buffer->string[input->start] != f_eol) { input->start++; - } + } // while + + fl_macro_fss_content_return_on_overflow((*buffer), (*input), (*found), f_none_on_eos, f_none_on_stop) if (found->used == already_used) { input->start++; -- 1.8.3.1