From 525217b1aec745256a16908142c73c25833b3e33 Mon Sep 17 00:00:00 2001 From: Guillaume Bougard Date: Fri, 11 Oct 2024 10:52:08 +0200 Subject: [PATCH] fix: Don't alert on possible confusion when reading a quoted value including a dash in configuration file Closes #789 --- Changes | 2 ++ lib/GLPI/Agent/Config.pm | 12 ++---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Changes b/Changes index 0b8cb2fa5..b8f333740 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,8 @@ Revision history for GLPI agent core: * fix #780: Avoid module loading path check error on windows if path includes a parenthesis +* fix #789: Avoid warning on commandline about possible confusion when reading quoted + configuration value including a dash from configuration file inventory: * Fix rare windows perl error during drives, ipv6 network or videos inventory diff --git a/lib/GLPI/Agent/Config.pm b/lib/GLPI/Agent/Config.pm index 09a01a34f..61ba68fc8 100644 --- a/lib/GLPI/Agent/Config.pm +++ b/lib/GLPI/Agent/Config.pm @@ -256,11 +256,7 @@ sub loadFromFile { # Extract value from quotes or clean any comment including preceding spaces if ($val =~ /^(['"])([^\1]*)\1/) { - my ($quote, $extract) = ( $1, $2 ); - $val =~ s/\s*#.+$//; - warn "Config: We may have been confused for $key quoted value, our extracted value: '$extract'\n" - if ($val ne "$quote$extract$quote"); - $val = $extract ; + $val = $2; } else { $val =~ s/\s*#.+$//; } @@ -277,11 +273,7 @@ sub loadFromFile { } elsif ($line =~ /^\s*include\s+(.+)$/i) { my $include = $1; if ($include =~ /^(['"])([^\1]*)\1/) { - my ($quote, $extract) = ( $1, $2 ); - $include =~ s/\s*#.+$//; - warn "Config: We may have been confused for include quoted path, our extracted path: '$extract'\n" - if ($include ne "$quote$extract$quote"); - $include = $extract ; + $include = $2; } else { $include =~ s/\s*#.+$//; }