Migrating from the old way to the new way results in extra new lines because of the first and last new line being printed.
Remove the extra new line being printed but still print in all other cases.
byte_dump_print_file_header(&main->program.output, f_string_empty_s);
byte_dump_process_file(main, f_string_empty_s, file);
+
+ if (main->setting.files.used && F_status_is_error_not(main->setting.state.status)) {
+ f_print_dynamic_raw(f_string_eol_s, main->program.output.to);
+ }
}
if (main->setting.files.used && F_status_is_error_not(main->setting.state.status)) {
f_file_stream_close(&file);
if (F_status_is_error(main->setting.state.status)) break;
+
+ if (i + 1 < main->setting.files.used) {
+ f_print_dynamic_raw(f_string_eol_s, main->program.output.to);
+ }
} // for
}
else {
f_file_stream_lock(print->to);
if (name.used) {
- fl_print_format("%r%[%r of: %]%[", print->to, f_string_eol_s, print->set->title, byte_dump_program_name_long_s, print->set->title, print->set->notable);
+ fl_print_format("%[%r of: %]%[", print->to, print->set->title, byte_dump_program_name_long_s, print->set->title, print->set->notable);
fl_print_format("%Q%] %[(in ", print->to, name, print->set->notable, print->set->title);
}
else {
- fl_print_format("%r%[Piped %q: (in ", print->to, f_string_eol_s, print->set->title, byte_dump_program_name_long_s);
+ fl_print_format("%[Piped %q: (in ", print->to, print->set->title, byte_dump_program_name_long_s);
}
if (main->setting.mode == byte_dump_mode_hexidecimal_e) {
f_file_stream_lock(print->to);
- fl_print_format("%[Invalid UTF-8 codes were detected for file '%]", print->to, print->set->error, print->set->error);
+ fl_print_format("%r%[Invalid UTF-8 codes were detected for file '%]", print->to, f_string_eol_s, print->set->error, print->set->error);
fl_print_format("%[%Q%]", print->to, print->set->notable, name.used ? name : f_string_ascii_minus_s, print->set->notable);
- fl_print_format("%['.%]%r%r", print->to, print->set->error, print->set->error, f_string_eol_s, f_string_eol_s);
+ fl_print_format("%['.%]%r", print->to, print->set->error, print->set->error, f_string_eol_s);
f_file_stream_unlock(print->to);
}
}
- f_print_dynamic_raw(f_string_eol_s, main->program.output.to);
-
f_file_stream_unlock(main->program.output.to);
f_file_stream_flush(main->program.output.to);