From 09063e93ea6729a22876d482590ff2f8822425aa Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 18 Jul 2019 22:38:41 -0500 Subject: [PATCH] Bugfix: firewall show command operating as lock The debug parameters is conditionally enabled/disabled but the enum is not. Make the enum conditionally enable/disable the debug option to prevent the wrong id from being used when debug is disabled. Fix the alignment of the debug message. Conditionally enable/disable displaying the debug in the help. --- level_3/firewall/c/firewall.c | 14 ++++++++------ level_3/firewall/c/firewall.h | 6 +++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index c962a2d..5e66d63 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -59,12 +59,14 @@ extern "C"{ fl_print_color(f_standard_output, data.context.standout, data.context.reset, f_console_standard_long_version); printf(" Print only the version number"); - printf("\n %s", f_console_symbol_short_disable); - fl_print_color(f_standard_output, data.context.standout, data.context.reset, f_console_standard_short_debug); - - printf(", %s", f_console_symbol_long_disable); - fl_print_color(f_standard_output, data.context.standout, data.context.reset, f_console_standard_long_debug); - printf(" Enable debugging"); + #ifdef _en_firewall_debug_ + printf("\n %s", f_console_symbol_short_disable); + fl_print_color(f_standard_output, data.context.standout, data.context.reset, f_console_standard_short_debug); + + printf(", %s", f_console_symbol_long_disable); + fl_print_color(f_standard_output, data.context.standout, data.context.reset, f_console_standard_long_debug); + printf(" Enable debugging"); + #endif // _en_firewall_debug_ printf("\n\n"); fl_print_color(f_standard_output, data.context.important, data.context.reset, " Available Commands: "); diff --git a/level_3/firewall/c/firewall.h b/level_3/firewall/c/firewall.h index 062d1ef..034f43d 100644 --- a/level_3/firewall/c/firewall.h +++ b/level_3/firewall/c/firewall.h @@ -212,7 +212,11 @@ extern "C"{ firewall_parameter_light, firewall_parameter_no_color, firewall_parameter_version, - firewall_parameter_debug, + + #ifdef _en_firewall_debug_ + firewall_parameter_debug, + #endif // _en_firewall_debug_ + firewall_parameter_command_start, firewall_parameter_command_stop, firewall_parameter_command_restart, -- 1.8.3.1