This (unfortunately) adds more logic to processing the case when `--original` is used and the Object is empty.
This makes me wonder if I have to implement the opener range.
I was not happy about adding the `close` for memory and space reasons.
Adding this would introduce more inefficiencies.
I may end up having to add support for processing different types of structures if I want to support the simple Object and Content without the `open` and `close` positions as well as with those positions.
The focus in this commit is only on fixing the printing and does not introduce any of the behavior that I described here.
Update the runtime tests for all of the FSS Read programs.
Some of the tests were missing or were incorrect such that this bug slipped by without detection.
The FSS Payload Read tests now have the (missing) NULL characters added to them.
}
}
}
+ else if (data->option & fss_basic_list_read_data_option_content_d) {
+
+ // An empty Object might still have white space.
+ if (at < data->contents.used && data->contents.array[at].used && data->contents.array[at].array[0].start <= data->contents.array[at].array[0].stop) {
+
+ // Skip past the new line and the Object opener.
+ if (data->contents.array[at].array[0].start && data->contents.array[at].array[0].start - 1) {
+ before.stop = data->contents.array[at].array[0].start - 2;
+
+ if (f_fss_basic_list_open_s.used) {
+ --before.stop;
+ }
+
+ before.start = before.stop;
+
+ while (before.start && data->buffer.string[before.start] != f_string_eol_s.string[0]) --before.start;
+
+ if (data->buffer.string[before.start] == f_string_eol_s.string[0]) ++before.start;
+ }
+ }
+ }
}
if (before.start <= before.stop) {
\# Valid Object :
with content.
-:
+ :
Has no Object name (only white space) and is oddly spaced.
мир :
\# Valid Object :
with content.
-:
+ :
Has no Object name (only white space) and is oddly spaced.
мир :
fss_basic_list_read +n -ocs 5 ${file_source} > ${test_current}object_and_content-select-5.expect &&
fss_basic_list_read +n -ocs 6 ${file_source} > ${test_current}object_and_content-select-6.expect &&
fss_basic_list_read +n -ocs 100 ${file_source} > ${test_current}object_and_content-select-100.expect &&
+ fss_basic_list_read +n -ocsO 0 ${file_source} > ${test_current}object_and_content-select-0-original.expect &&
+ fss_basic_list_read +n -ocsO 1 ${file_source} > ${test_current}object_and_content-select-1-original.expect &&
+ fss_basic_list_read +n -ocsO 5 ${file_source} > ${test_current}object_and_content-select-5-original.expect &&
+ fss_basic_list_read +n -ocsO 6 ${file_source} > ${test_current}object_and_content-select-6-original.expect &&
+ fss_basic_list_read +n -ocsO 100 ${file_source} > ${test_current}object_and_content-select-100-original.expect &&
fss_basic_list_read +n -ocC ${file_source} > ${test_current}object_and_content-columns.expect &&
fss_basic_list_read +n -ocCe ${file_source} > ${test_current}object_and_content-columns-empty.expect &&
fss_basic_list_read +n -oca 0 ${file_source} > ${test_current}object_and_content-at-0.expect &&
fss_basic_list_read +n -ocs 5 ${file_source} > ${test_current}object_and_content-select-5.expect &&
fss_basic_list_read +n -ocs 6 ${file_source} > ${test_current}object_and_content-select-6.expect &&
fss_basic_list_read +n -ocs 100 ${file_source} > ${test_current}object_and_content-select-100.expect &&
+ fss_basic_list_read +n -ocsO 0 ${file_source} > ${test_current}object_and_content-select-0-original.expect &&
+ fss_basic_list_read +n -ocsO 1 ${file_source} > ${test_current}object_and_content-select-1-original.expect &&
+ fss_basic_list_read +n -ocsO 5 ${file_source} > ${test_current}object_and_content-select-5-original.expect &&
+ fss_basic_list_read +n -ocsO 6 ${file_source} > ${test_current}object_and_content-select-6-original.expect &&
+ fss_basic_list_read +n -ocsO 100 ${file_source} > ${test_current}object_and_content-select-100-original.expect &&
fss_basic_list_read +n -ocC ${file_source} > ${test_current}object_and_content-columns.expect &&
fss_basic_list_read +n -ocCe ${file_source} > ${test_current}object_and_content-columns-empty.expect &&
fss_basic_list_read +n -oca 0 ${file_source} > ${test_current}object_and_content-at-0.expect &&
fss_basic_read +n -ocs 5 ${file_source} > ${test_current}object_and_content-select-5.expect &&
fss_basic_read +n -ocs 6 ${file_source} > ${test_current}object_and_content-select-6.expect &&
fss_basic_read +n -ocs 100 ${file_source} > ${test_current}object_and_content-select-100.expect &&
+ fss_basic_read +n -ocsO 0 ${file_source} > ${test_current}object_and_content-select-0-original.expect &&
+ fss_basic_read +n -ocsO 1 ${file_source} > ${test_current}object_and_content-select-1-original.expect &&
+ fss_basic_read +n -ocsO 5 ${file_source} > ${test_current}object_and_content-select-5-original.expect &&
+ fss_basic_read +n -ocsO 6 ${file_source} > ${test_current}object_and_content-select-6-original.expect &&
+ fss_basic_read +n -ocsO 100 ${file_source} > ${test_current}object_and_content-select-100-original.expect &&
fss_basic_read +n -ocC ${file_source} > ${test_current}object_and_content-columns.expect &&
fss_basic_read +n -ocCe ${file_source} > ${test_current}object_and_content-columns-empty.expect &&
fss_basic_read +n -oca 0 ${file_source} > ${test_current}object_and_content-at-0.expect &&
fss_basic_read +n -ocs 5 ${file_source} > ${test_current}object_and_content-select-5.expect &&
fss_basic_read +n -ocs 6 ${file_source} > ${test_current}object_and_content-select-6.expect &&
fss_basic_read +n -ocs 100 ${file_source} > ${test_current}object_and_content-select-100.expect &&
+ fss_basic_read +n -ocsO 0 ${file_source} > ${test_current}object_and_content-select-0-original.expect &&
+ fss_basic_read +n -ocsO 1 ${file_source} > ${test_current}object_and_content-select-1-original.expect &&
+ fss_basic_read +n -ocsO 5 ${file_source} > ${test_current}object_and_content-select-5-original.expect &&
+ fss_basic_read +n -ocsO 6 ${file_source} > ${test_current}object_and_content-select-6-original.expect &&
+ fss_basic_read +n -ocsO 100 ${file_source} > ${test_current}object_and_content-select-100-original.expect &&
fss_basic_read +n -ocC ${file_source} > ${test_current}object_and_content-columns.expect &&
fss_basic_read +n -ocCe ${file_source} > ${test_current}object_and_content-columns-empty.expect &&
fss_basic_read +n -oca 0 ${file_source} > ${test_current}object_and_content-at-0.expect &&
}
and outside.
}
-{
+ {
Has no Object name (only white space) and is oddly spaced.
}
мир {
fss_embedded_list_read +n -ocs 5 ${file_source} > ${test_current}object_and_content-select-5.expect &&
fss_embedded_list_read +n -ocs 6 ${file_source} > ${test_current}object_and_content-select-6.expect &&
fss_embedded_list_read +n -ocs 100 ${file_source} > ${test_current}object_and_content-select-100.expect &&
+ fss_embedded_list_read +n -ocsO 0 ${file_source} > ${test_current}object_and_content-select-0-original.expect &&
+ fss_embedded_list_read +n -ocsO 1 ${file_source} > ${test_current}object_and_content-select-1-original.expect &&
+ fss_embedded_list_read +n -ocsO 5 ${file_source} > ${test_current}object_and_content-select-5-original.expect &&
+ fss_embedded_list_read +n -ocsO 6 ${file_source} > ${test_current}object_and_content-select-6-original.expect &&
+ fss_embedded_list_read +n -ocsO 100 ${file_source} > ${test_current}object_and_content-select-100-original.expect &&
fss_embedded_list_read +n -ocC ${file_source} > ${test_current}object_and_content-columns.expect &&
fss_embedded_list_read +n -ocCe ${file_source} > ${test_current}object_and_content-columns-empty.expect &&
fss_embedded_list_read +n -oca 0 ${file_source} > ${test_current}object_and_content-at-0.expect &&
fss_embedded_list_read +n -ocs 5 ${file_source} > ${test_current}object_and_content-select-5.expect &&
fss_embedded_list_read +n -ocs 6 ${file_source} > ${test_current}object_and_content-select-6.expect &&
fss_embedded_list_read +n -ocs 100 ${file_source} > ${test_current}object_and_content-select-100.expect &&
+ fss_embedded_list_read +n -ocsO 0 ${file_source} > ${test_current}object_and_content-select-0-original.expect &&
+ fss_embedded_list_read +n -ocsO 1 ${file_source} > ${test_current}object_and_content-select-1-original.expect &&
+ fss_embedded_list_read +n -ocsO 5 ${file_source} > ${test_current}object_and_content-select-5-original.expect &&
+ fss_embedded_list_read +n -ocsO 6 ${file_source} > ${test_current}object_and_content-select-6-original.expect &&
+ fss_embedded_list_read +n -ocsO 100 ${file_source} > ${test_current}object_and_content-select-100-original.expect &&
fss_embedded_list_read +n -ocC ${file_source} > ${test_current}object_and_content-columns.expect &&
fss_embedded_list_read +n -ocCe ${file_source} > ${test_current}object_and_content-columns-empty.expect &&
fss_embedded_list_read +n -oca 0 ${file_source} > ${test_current}object_and_content-at-0.expect &&
if (at >= data->objects.used) return;
- if ((data->option & fss_extended_list_read_data_option_content_d) && (!(data->option & fss_extended_list_read_data_option_original_d) || (data->option & fss_extended_list_read_data_option_trim_d))) {
- const f_string_range_t before = fss_extended_list_read_print_at_determine_begin(main, data, at);
+ if ((data->option & fss_extended_list_read_data_option_content_d)) {
+ if (!(data->option & fss_extended_list_read_data_option_original_d) || (data->option & fss_extended_list_read_data_option_trim_d)) {
+ const f_string_range_t before = fss_extended_list_read_print_at_determine_begin(main, data, at);
- if (before.start <= before.stop) {
- f_print_except_dynamic_partial(data->buffer, before, delimits_object, main->output.to.stream);
+ if (before.start <= before.stop) {
+ f_print_except_dynamic_partial(data->buffer, before, delimits_object, main->output.to.stream);
+ }
}
}
}
}
}
+ else if (data->option & fss_extended_list_read_data_option_content_d) {
+
+ // An empty Object might still have white space.
+ if (at < data->contents.used && data->contents.array[at].used && data->contents.array[at].array[0].start <= data->contents.array[at].array[0].stop) {
+
+ // Skip past the new line and the Object opener.
+ if (data->contents.array[at].array[0].start && data->contents.array[at].array[0].start - 1) {
+ before.stop = data->contents.array[at].array[0].start - 2;
+
+ if (f_fss_extended_list_open_s.used) {
+ --before.stop;
+ }
+
+ before.start = before.stop;
+
+ while (before.start && data->buffer.string[before.start] != f_string_eol_s.string[0]) --before.start;
+
+ if (data->buffer.string[before.start] == f_string_eol_s.string[0]) ++before.start;
+ }
+ }
+ }
}
if (before.start <= before.stop) {
\# Valid Object {
with content.
}
-{
+ {
Has no Object name (only white space) and is oddly spaced.
}
мир {
\# Valid Object {
with content.
}
-{
+ {
Has no Object name (only white space) and is oddly spaced.
}
мир {
fss_extended_list_read +n -ocs 5 ${file_source} > ${test_current}object_and_content-select-5.expect &&
fss_extended_list_read +n -ocs 6 ${file_source} > ${test_current}object_and_content-select-6.expect &&
fss_extended_list_read +n -ocs 100 ${file_source} > ${test_current}object_and_content-select-100.expect &&
+ fss_extended_list_read +n -ocsO 0 ${file_source} > ${test_current}object_and_content-select-0-original.expect &&
+ fss_extended_list_read +n -ocsO 1 ${file_source} > ${test_current}object_and_content-select-1-original.expect &&
+ fss_extended_list_read +n -ocsO 5 ${file_source} > ${test_current}object_and_content-select-5-original.expect &&
+ fss_extended_list_read +n -ocsO 6 ${file_source} > ${test_current}object_and_content-select-6-original.expect &&
+ fss_extended_list_read +n -ocsO 100 ${file_source} > ${test_current}object_and_content-select-100-original.expect &&
fss_extended_list_read +n -ocC ${file_source} > ${test_current}object_and_content-columns.expect &&
fss_extended_list_read +n -ocCe ${file_source} > ${test_current}object_and_content-columns-empty.expect &&
fss_extended_list_read +n -oca 0 ${file_source} > ${test_current}object_and_content-at-0.expect &&
fss_extended_list_read +n -ocs 5 ${file_source} > ${test_current}object_and_content-select-5.expect &&
fss_extended_list_read +n -ocs 6 ${file_source} > ${test_current}object_and_content-select-6.expect &&
fss_extended_list_read +n -ocs 100 ${file_source} > ${test_current}object_and_content-select-100.expect &&
+ fss_extended_list_read +n -ocsO 0 ${file_source} > ${test_current}object_and_content-select-0-original.expect &&
+ fss_extended_list_read +n -ocsO 1 ${file_source} > ${test_current}object_and_content-select-1-original.expect &&
+ fss_extended_list_read +n -ocsO 5 ${file_source} > ${test_current}object_and_content-select-5-original.expect &&
+ fss_extended_list_read +n -ocsO 6 ${file_source} > ${test_current}object_and_content-select-6-original.expect &&
+ fss_extended_list_read +n -ocsO 100 ${file_source} > ${test_current}object_and_content-select-100-original.expect &&
fss_extended_list_read +n -ocC ${file_source} > ${test_current}object_and_content-columns.expect &&
fss_extended_list_read +n -ocCe ${file_source} > ${test_current}object_and_content-columns-empty.expect &&
fss_extended_list_read +n -oca 0 ${file_source} > ${test_current}object_and_content-at-0.expect &&
fss_extended_read +n -ocs 5 ${file_source} > ${test_current}object_and_content-select-5.expect &&
fss_extended_read +n -ocs 6 ${file_source} > ${test_current}object_and_content-select-6.expect &&
fss_extended_read +n -ocs 100 ${file_source} > ${test_current}object_and_content-select-100.expect &&
+ fss_extended_read +n -ocsO 0 ${file_source} > ${test_current}object_and_content-select-0-original.expect &&
+ fss_extended_read +n -ocsO 1 ${file_source} > ${test_current}object_and_content-select-1-original.expect &&
+ fss_extended_read +n -ocsO 5 ${file_source} > ${test_current}object_and_content-select-5-original.expect &&
+ fss_extended_read +n -ocsO 6 ${file_source} > ${test_current}object_and_content-select-6-original.expect &&
+ fss_extended_read +n -ocsO 100 ${file_source} > ${test_current}object_and_content-select-100-original.expect &&
fss_extended_read +n -ocC ${file_source} > ${test_current}object_and_content-columns.expect &&
fss_extended_read +n -ocCe ${file_source} > ${test_current}object_and_content-columns-empty.expect &&
fss_extended_read +n -oca 0 ${file_source} > ${test_current}object_and_content-at-0.expect &&
fss_extended_read +n -ocs 5 ${file_source} > ${test_current}object_and_content-select-5.expect &&
fss_extended_read +n -ocs 6 ${file_source} > ${test_current}object_and_content-select-6.expect &&
fss_extended_read +n -ocs 100 ${file_source} > ${test_current}object_and_content-select-100.expect &&
+ fss_extended_read +n -ocsO 0 ${file_source} > ${test_current}object_and_content-select-0-original.expect &&
+ fss_extended_read +n -ocsO 1 ${file_source} > ${test_current}object_and_content-select-1-original.expect &&
+ fss_extended_read +n -ocsO 5 ${file_source} > ${test_current}object_and_content-select-5-original.expect &&
+ fss_extended_read +n -ocsO 6 ${file_source} > ${test_current}object_and_content-select-6-original.expect &&
+ fss_extended_read +n -ocsO 100 ${file_source} > ${test_current}object_and_content-select-100-original.expect &&
fss_extended_read +n -ocC ${file_source} > ${test_current}object_and_content-columns.expect &&
fss_extended_read +n -ocCe ${file_source} > ${test_current}object_and_content-columns-empty.expect &&
fss_extended_read +n -oca 0 ${file_source} > ${test_current}object_and_content-at-0.expect &&
}
}
}
+ else if (data->option & fss_payload_read_data_option_content_d) {
+
+ // An empty Object might still have white space.
+ if (at < data->contents.used && data->contents.array[at].used && data->contents.array[at].array[0].start <= data->contents.array[at].array[0].stop) {
+
+ // Skip past the new line and the Object opener.
+ if (data->contents.array[at].array[0].start && data->contents.array[at].array[0].start - 1) {
+ before.stop = data->contents.array[at].array[0].start - 2;
+
+ if (f_fss_payload_list_open_s.used) {
+ --before.stop;
+ }
+
+ before.start = before.stop;
+
+ while (before.start && data->buffer.string[before.start] != f_string_eol_s.string[0]) --before.start;
+
+ if (data->buffer.string[before.start] == f_string_eol_s.string[0]) ++before.start;
+ }
+ }
+ }
}
if (before.start <= before.stop) {
fss_payload_read +n -ocs 5 ${file_source} > ${test_current}object_and_content-select-5.expect &&
fss_payload_read +n -ocs 6 ${file_source} > ${test_current}object_and_content-select-6.expect &&
fss_payload_read +n -ocs 100 ${file_source} > ${test_current}object_and_content-select-100.expect &&
+ fss_payload_read +n -ocsO 0 ${file_source} > ${test_current}object_and_content-select-0-original.expect &&
+ fss_payload_read +n -ocsO 1 ${file_source} > ${test_current}object_and_content-select-1-original.expect &&
+ fss_payload_read +n -ocsO 5 ${file_source} > ${test_current}object_and_content-select-5-original.expect &&
+ fss_payload_read +n -ocsO 6 ${file_source} > ${test_current}object_and_content-select-6-original.expect &&
+ fss_payload_read +n -ocsO 100 ${file_source} > ${test_current}object_and_content-select-100-original.expect &&
+
fss_payload_read +n -ocC ${file_source} > ${test_current}object_and_content-columns.expect &&
fss_payload_read +n -ocCe ${file_source} > ${test_current}object_and_content-columns-empty.expect &&
fss_payload_read +n -oca 0 ${file_source} > ${test_current}object_and_content-at-0.expect &&