]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #2965 in SNORT/snort3 from ~SVLASIUK/snort3:dump_empty_modules...
authorMike Stepanek (mstepane) <mstepane@cisco.com>
Fri, 2 Jul 2021 10:27:05 +0000 (10:27 +0000)
committerMike Stepanek (mstepane) <mstepane@cisco.com>
Fri, 2 Jul 2021 10:27:05 +0000 (10:27 +0000)
Squashed commit of the following:

commit 8f2aa27901ee6785d6dcf95d7d0012b7845eabff
Author: Serhii Vlasiuk <svlasiuk@cisco.com>
Date:   Thu Jul 1 15:37:26 2021 +0300

    dump_config: support modules without config options in text format

src/dump_config/text_config_output.cc

index 832293afb31aaccbedfb777ecd20320906d085b9..7d567779009069ce9316f567396e0d33b182a505 100644 (file)
@@ -58,6 +58,12 @@ static void dump_value(const BaseConfigNode* node, const std::string& config_nam
 
 static void dump_tree(const BaseConfigNode* node, const std::string& config_name)
 {
+    if ( node->get_children().empty() and !node->get_parent_node() )
+    {
+        std::cout << config_name << std::endl;
+        return;
+    }
+
     Parameter::Type node_type = node->get_type();
 
     if ( node_type == Parameter::PT_TABLE )