commit c95832955e3349968c9973b2c14a45615186eb00
parent dae94a5fffd4365d0b3f544b1a784702ab03f23f
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date: Sat, 23 Jul 2016 00:00:23 +0200
sboconfig: allow comments and blank lines to be undisturbed
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/sboconfig b/sboconfig
@@ -169,6 +169,9 @@ sub _fixup_conf {
my @fixed;
my %keys;
foreach my $line (@lines) {
+ # if it's a comment or blank line, just pass it through
+ if ($line =~ /^(#|\s*$)/) { push @fixed, $line; next; }
+
my ($key, $val) = split /=/, $line;
next if exists $keys{$key};
$keys{$key}++;