[collectd] [PATCH] Collectd.pm: Fixed the check for complete function names in plugin_register.

Sebastian Harl sh at tokkee.org
Sun Apr 20 23:21:50 CEST 2008


plugin_register() checks if the registered function includes the plugin's
package name. Up to now, this check would also have succeeded if the
function name itself would be prepended by the package name. Now, the
check looks for the separator "::".

Signed-off-by: Sebastian Harl <sh at tokkee.org>
---
 bindings/perl/Collectd.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/bindings/perl/Collectd.pm b/bindings/perl/Collectd.pm
index 4377570..4ba9751 100644
--- a/bindings/perl/Collectd.pm
+++ b/bindings/perl/Collectd.pm
@@ -246,7 +246,7 @@ sub plugin_register {
 
 		my %p : shared;
 
-		if ($data !~ m/^$pkg/) {
+		if ($data !~ m/^$pkg\:\:/) {
 			$data = $pkg . "::" . $data;
 		}
 
-- 
1.5.5.29.g7134

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080420/cfa72763/attachment.pgp 


More information about the collectd mailing list