From: Kevin Day Date: Tue, 10 Nov 2020 02:19:03 +0000 (-0600) Subject: Cleanup: remove unnecessary tabbing and move newline. X-Git-Tag: 0.5.2~83 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=4eb8a2a7ce577c55294946079cda3343a3d618c9;p=fll Cleanup: remove unnecessary tabbing and move newline. Move the newline to its own printf function that is after any color codes. --- diff --git a/level_3/fake/c/main.c b/level_3/fake/c/main.c index b0bc9bd..7aa0125 100644 --- a/level_3/fake/c/main.c +++ b/level_3/fake/c/main.c @@ -15,25 +15,22 @@ int main(const unsigned long argc, const f_string_t *argv) { const f_console_arguments_t arguments = { argc, argv }; fake_data_t data = fake_data_t_initialize; - f_status_t status = F_none; - { - f_signal_set_empty(&data.signal.set); - f_signal_set_add(F_signal_abort, &data.signal.set); - f_signal_set_add(F_signal_hangup, &data.signal.set); - f_signal_set_add(F_signal_interrupt, &data.signal.set); - f_signal_set_add(F_signal_quit, &data.signal.set); - f_signal_set_add(F_signal_termination, &data.signal.set); - f_signal_set_handle(SIG_BLOCK, &data.signal.set); - - status = f_signal_open(&data.signal); - - // if there is an error opening a signal descriptor, then do not handle signals. - if (F_status_is_error(status)) { - f_signal_set_handle(SIG_UNBLOCK, &data.signal.set); - f_signal_close(&data.signal); - } + f_signal_set_empty(&data.signal.set); + f_signal_set_add(F_signal_abort, &data.signal.set); + f_signal_set_add(F_signal_hangup, &data.signal.set); + f_signal_set_add(F_signal_interrupt, &data.signal.set); + f_signal_set_add(F_signal_quit, &data.signal.set); + f_signal_set_add(F_signal_termination, &data.signal.set); + f_signal_set_handle(SIG_BLOCK, &data.signal.set); + + status = f_signal_open(&data.signal); + + // if there is an error opening a signal descriptor, then do not handle signals. + if (F_status_is_error(status)) { + f_signal_set_handle(SIG_UNBLOCK, &data.signal.set); + f_signal_close(&data.signal); } // @fixme: bad design in POSIX where there is no get umask without setting it. diff --git a/level_3/fake/c/private-fake.c b/level_3/fake/c/private-fake.c index fb89392..8e550ca 100644 --- a/level_3/fake/c/private-fake.c +++ b/level_3/fake/c/private-fake.c @@ -937,7 +937,8 @@ extern "C" { if (data.error.verbosity != f_console_verbosity_quiet) { fprintf(data.error.to.stream, "%c", f_string_eol[0]); - fl_color_print(data.error.to.stream, data.context.set.error, "ALERT: An appropriate exit signal has been received, now aborting.%c", f_string_eol[0]); + fl_color_print(data.error.to.stream, data.context.set.error, "ALERT: An appropriate exit signal has been received, now aborting."); + fprintf(data.error.to.stream, "%c", f_string_eol[0]); } return F_true;