diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-07-23 00:00:23 +0200 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-07-23 00:00:23 +0200 |
commit | c95832955e3349968c9973b2c14a45615186eb00 (patch) | |
tree | 71402f3c7f0655cab2b19085cc90a0bae73a3c95 | |
parent | dae94a5fffd4365d0b3f544b1a784702ab03f23f (diff) | |
download | sbotools2-c95832955e3349968c9973b2c14a45615186eb00.tar.xz |
sboconfig: allow comments and blank lines to be undisturbed
-rwxr-xr-x | sboconfig | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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}++; |