From f02cb4e0cce374d92e6c2702fe113a3b6c81e304 Mon Sep 17 00:00:00 2001 From: Paul Dugas Date: Sat, 2 Apr 2016 10:06:25 -0400 Subject: Fixed regex in plugin_exit() that handles hyphen for LONGOUTPUT. Added tests. --- lib/Monitoring/Plugin/Functions.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Monitoring/Plugin/Functions.pm b/lib/Monitoring/Plugin/Functions.pm index a19db49..5946c7d 100644 --- a/lib/Monitoring/Plugin/Functions.pm +++ b/lib/Monitoring/Plugin/Functions.pm @@ -119,7 +119,7 @@ sub plugin_exit { # Setup output my $output = "$STATUS_TEXT{$code}"; if (defined $message && $message ne '') { - $output .= " - " unless $message =~ /^[ \f\r\t\w]*\n/; + $output .= " - " unless $message =~ /^\h*\R/; $output .= $message; } my $shortname = ($arg->{plugin} ? $arg->{plugin}->shortname : undef); -- cgit v1.2.3-74-g34f1