From: Kevin Day Date: Thu, 10 Feb 2022 03:47:58 +0000 (-0600) Subject: Regression: The parameters should not print when string.used is 0. X-Git-Tag: 0.5.8~65 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=70d0c750ccba24fbb6c163ad5f2e6003d4699add;p=fll Regression: The parameters should not print when string.used is 0. Empty brackets should not be printed when the parameters is empty. --- diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index f2b89ec..acf7832 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -51,8 +51,12 @@ extern "C" { fl_print_format(" %[%Q%]", output.stream, context.set.standout, name, context.set.standout); fl_print_format(" %[[%] options %[]%]", output.stream, context.set.notable, context.set.notable, context.set.notable, context.set.notable); - fl_print_format(" %[[%] %Q", output.stream, context.set.notable, context.set.notable, parameters); - fl_print_format(" %[]%]%r%r", output.stream, context.set.notable, context.set.notable, f_string_eol_s, f_string_eol_s); + + if (parameters.used) { + fl_print_format(" %[[%] %Q %[]%]", output.stream, context.set.notable, context.set.notable, parameters, context.set.notable, context.set.notable); + } + + fl_print_format("%r%r", output.stream, f_string_eol_s, f_string_eol_s); return F_none; } diff --git a/level_2/fll_program/c/program.h b/level_2/fll_program/c/program.h index ce4bad5..fe5d141 100644 --- a/level_2/fll_program/c/program.h +++ b/level_2/fll_program/c/program.h @@ -152,8 +152,9 @@ extern "C" { * @param name * The name of the program. * @param parameters - * The non-option parameters to be displayed inside the brackets. + * (optional) The non-option parameters to be displayed inside the brackets. * Set the first array value to EOS to disable printing of parameters. + * Set parameters.used to 0 to disable. * * @return * F_none on success.