From 0b40e1fbdc404d980cb6b4256d9ff6ba6ab94bb8 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Tue, 25 Mar 2008 19:31:37 +0100 Subject: [PATCH] contrib/cussh.pl: Fixed input line parsing. The regexes parsing the user input lines have been adopted to take into account that the newline at the end of the line has been removed. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- contrib/cussh.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/cussh.pl b/contrib/cussh.pl index df3df344..6da2856d 100755 --- a/contrib/cussh.pl +++ b/contrib/cussh.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl # # collectd - contrib/cussh.pl -# Copyright (C) 2007 Sebastian Harl +# Copyright (C) 2007-2008 Sebastian Harl # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -83,7 +83,7 @@ use Collectd::Unixsock(); last if ($line =~ m/^quit$/i); - my ($cmd) = $line =~ m/^(\w+)\s+/; + my ($cmd) = $line =~ m/^(\w+)\s*/; $line = $'; next if (! $cmd); @@ -113,7 +113,7 @@ sub getid { print $$string . $/; my ($h, $p, $pi, $t, $ti) = - $$string =~ m/^(\w+)\/(\w+)(?:-(\w+))?\/(\w+)(?:-(\w+))?\s+/; + $$string =~ m/^(\w+)\/(\w+)(?:-(\w+))?\/(\w+)(?:-(\w+))?\s*/; $$string = $'; return if ((! $h) || (! $p) || (! $t)); -- 2.30.2