Skip to content

Commit 525217b

Browse files
committed
fix: Don't alert on possible confusion when reading a quoted value including a dash in configuration file
Closes #789
1 parent dbf463a commit 525217b

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

Changes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Revision history for GLPI agent
55
core:
66
* fix #780: Avoid module loading path check error on windows if path includes a
77
parenthesis
8+
* fix #789: Avoid warning on commandline about possible confusion when reading quoted
9+
configuration value including a dash from configuration file
810

911
inventory:
1012
* Fix rare windows perl error during drives, ipv6 network or videos inventory

lib/GLPI/Agent/Config.pm

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,7 @@ sub loadFromFile {
256256

257257
# Extract value from quotes or clean any comment including preceding spaces
258258
if ($val =~ /^(['"])([^\1]*)\1/) {
259-
my ($quote, $extract) = ( $1, $2 );
260-
$val =~ s/\s*#.+$//;
261-
warn "Config: We may have been confused for $key quoted value, our extracted value: '$extract'\n"
262-
if ($val ne "$quote$extract$quote");
263-
$val = $extract ;
259+
$val = $2;
264260
} else {
265261
$val =~ s/\s*#.+$//;
266262
}
@@ -277,11 +273,7 @@ sub loadFromFile {
277273
} elsif ($line =~ /^\s*include\s+(.+)$/i) {
278274
my $include = $1;
279275
if ($include =~ /^(['"])([^\1]*)\1/) {
280-
my ($quote, $extract) = ( $1, $2 );
281-
$include =~ s/\s*#.+$//;
282-
warn "Config: We may have been confused for include quoted path, our extracted path: '$extract'\n"
283-
if ($include ne "$quote$extract$quote");
284-
$include = $extract ;
276+
$include = $2;
285277
} else {
286278
$include =~ s/\s*#.+$//;
287279
}

0 commit comments

Comments
 (0)