From 580525bf745f0987061d48141ef158092aa1deb3 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 29 Mar 2025 22:10:01 -0500 Subject: [PATCH] Update: Ensure the FLL print help option functions support NULL description. --- level_2/fll_program/c/private-program.c | 2 +- level_2/fll_program/c/program/print.c | 6 +++--- level_2/fll_program/c/program/print.h | 8 ++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/level_2/fll_program/c/private-program.c b/level_2/fll_program/c/private-program.c index 66dbc31..e1dd064 100644 --- a/level_2/fll_program/c/private-program.c +++ b/level_2/fll_program/c/private-program.c @@ -71,7 +71,7 @@ extern "C" { f_status_t private_fll_program_print_help_option(fl_print_t * const print, const f_string_static_t option_short, const f_string_static_t option_long, const f_string_static_t symbol_short, const f_string_static_t symbol_long, const char * const description) { fl_print_format(" %Q%[%Q%]", print->to, symbol_short, print->set->standout, option_short, print->set->standout); - fl_print_format(", %Q%[%Q%] %S%r", print->to, symbol_long, print->set->standout, option_long, print->set->standout, description, f_string_eol_s); + fl_print_format(", %Q%[%Q%]%s%S%r", print->to, symbol_long, print->set->standout, option_long, print->set->standout, description ? " " : "", description, f_string_eol_s); return F_okay; } diff --git a/level_2/fll_program/c/program/print.c b/level_2/fll_program/c/program/print.c index d51cbe9..eccaafa 100644 --- a/level_2/fll_program/c/program/print.c +++ b/level_2/fll_program/c/program/print.c @@ -609,7 +609,7 @@ extern "C" { if (!print) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - fl_print_format(" %Q%[%Q%] %S%r", print->to, symbol_long, print->set->standout, option_long, print->set->standout, description, f_string_eol_s); + fl_print_format(" %Q%[%Q%]%s%S%r", print->to, symbol_long, print->set->standout, option_long, print->set->standout, description ? " " : "", description, f_string_eol_s); return F_okay; } @@ -621,7 +621,7 @@ extern "C" { if (!print) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - fl_print_format(" %[%Q%] %S%r", print->to, print->set->standout, option_other, print->set->standout, description, f_string_eol_s); + fl_print_format(" %[%Q%]%s%S%r", print->to, print->set->standout, option_other, print->set->standout, description ? " " : "", description, f_string_eol_s); return F_okay; } @@ -633,7 +633,7 @@ extern "C" { if (!print) return F_status_set_error(F_parameter); #endif // _di_level_2_parameter_checking_ - fl_print_format(" %Q%[%Q%] %S%r", print->to, symbol_short, print->set->standout, option_short, print->set->standout, description, f_string_eol_s); + fl_print_format(" %Q%[%Q%]%s%S%r",print->to, symbol_short, print->set->standout, option_short, print->set->standout, description ? " " : "", description, f_string_eol_s); return F_okay; } diff --git a/level_2/fll_program/c/program/print.h b/level_2/fll_program/c/program/print.h index 90f86bf..07b2f63 100644 --- a/level_2/fll_program/c/program/print.h +++ b/level_2/fll_program/c/program/print.h @@ -880,6 +880,8 @@ extern "C" { * @param description * A desciption associated with the option. * + * Set too NULL to disable. + * * @return * F_okay on success. * F_output_not on success, but no printing is performed. @@ -908,6 +910,8 @@ extern "C" { * @param description * A desciption associated with the option. * + * Set too NULL to disable. + * * @return * F_okay on success. * F_output_not on success, but no printing is performed. @@ -934,6 +938,8 @@ extern "C" { * @param description * A desciption associated with the option. * + * Set too NULL to disable. + * * @return * F_okay on success. * F_output_not on success, but no printing is performed. @@ -962,6 +968,8 @@ extern "C" { * @param description * A desciption associated with the option. * + * Set too NULL to disable. + * * @return * F_okay on success. * F_output_not on success, but no printing is performed. -- 1.8.3.1