]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
general-functions.pl: readhash() Add code to handle optional comments in files
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 13 Dec 2017 13:53:51 +0000 (14:53 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 26 Jul 2018 09:49:56 +0000 (11:49 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
config/cfgroot/general-functions.pl

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