aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-07-23 00:00:23 +0200
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-07-23 00:00:23 +0200
commitc95832955e3349968c9973b2c14a45615186eb00 (patch)
tree71402f3c7f0655cab2b19085cc90a0bae73a3c95
parentdae94a5fffd4365d0b3f544b1a784702ab03f23f (diff)
downloadsbotools2-c95832955e3349968c9973b2c14a45615186eb00.tar.xz
sboconfig: allow comments and blank lines to be undisturbed
-rwxr-xr-xsboconfig3
1 files changed, 3 insertions, 0 deletions
diff --git a/sboconfig b/sboconfig
index 819602d..0dbebb0 100755
--- 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}++;