From 70d0c750ccba24fbb6c163ad5f2e6003d4699add Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 9 Feb 2022 21:47:58 -0600 Subject: [PATCH] Regression: The parameters should not print when string.used is 0. Empty brackets should not be printed when the parameters is empty. --- level_2/fll_program/c/program.c | 8 ++++++-- level_2/fll_program/c/program.h | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) 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. -- 1.8.3.1