general-functions.pl: readhash() Add code to handle optional comments in files

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
Stefan Schantl
2017-12-13 14:53:51 +01:00
parent ef5171ab71
commit 9f5247f60c

View File

@@ -149,6 +149,10 @@ sub readhash
while (<FILE>)
{
chop;
# Skip comments.
next if ($_ =~ /\#/);
($var, $val) = split /=/, $_, 2;
if ($var)
{