From: Josh Date: Mon, 17 Nov 2014 16:12:28 +0000 (-0600) Subject: fixing snort2lua help output X-Git-Tag: 3.0.0-233~1211^2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e44ac54b02a52932fe2096eda821901efbfe2b5a;p=thirdparty%2Fsnort3.git fixing snort2lua help output --- diff --git a/tools/snort2lua/helpers/markup.cc b/tools/snort2lua/helpers/markup.cc index c7bee992b..3f5daacaf 100644 --- a/tools/snort2lua/helpers/markup.cc +++ b/tools/snort2lua/helpers/markup.cc @@ -87,3 +87,12 @@ const string& Markup::escape(const string& s) #endif return m; } + + +const char* Markup::add_newline() +{ + static const char newline = '\n'; + static const char empty = '\0'; + + return enabled ? &newline : ∅ +} diff --git a/tools/snort2lua/helpers/markup.h b/tools/snort2lua/helpers/markup.h index b925ea7e4..356075189 100644 --- a/tools/snort2lua/helpers/markup.h +++ b/tools/snort2lua/helpers/markup.h @@ -36,6 +36,7 @@ public: static const std::string& emphasis(const std::string&); static const std::string& escape(const char* const); static const std::string& escape(const std::string&); + static const char* add_newline(); private: static bool enabled; diff --git a/tools/snort2lua/helpers/parse_cmd_line.cc b/tools/snort2lua/helpers/parse_cmd_line.cc index c2ed49723..f1ee8f6a9 100644 --- a/tools/snort2lua/helpers/parse_cmd_line.cc +++ b/tools/snort2lua/helpers/parse_cmd_line.cc @@ -502,7 +502,7 @@ static void help_args(const char* /*pfx*/, const char* /*val*/) break; } - std::cout << "\n" << std::endl; + std::cout << Markup::add_newline() << std::endl; } ++p; }