From 27d5834858941640a5bdd2b40f82739710e0ddb9 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Sun, 6 Dec 2015 11:27:29 +0100 Subject: [PATCH] Remove any whitespaces from configlines. Previously only whitespaces from the begin and end of a config line has been dropped which cause troubles if a line contains them between the config option and the value. (LogLevel = debug) Now simply all whitespaces will be dropped which solved those problems. Signed-off-by: Stefan Schantl --- modules/Config.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/Config.pm b/modules/Config.pm index 9a8e1fd..569b2ce 100644 --- a/modules/Config.pm +++ b/modules/Config.pm @@ -91,15 +91,14 @@ sub ReadConfig ($) { # Remove any newlines. chomp($line); - # Remove any spaces at the start and end of the line. - $line =~ s/^\s*//; - $line =~ s/\s*$//; - # Check line lenght, skip it, if it is longer than, the # allowed maximum. my $length = length("$line"); next if ($length gt $maxlength); + # Remove any whitespaces. + $line=~ s/ //g; + # Splitt line into two parts. my ($option, $value) = split (/=/, $line); -- 2.39.2