summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xloadbars12
1 files changed, 7 insertions, 5 deletions
diff --git a/loadbars b/loadbars
index c842ecd..228da73 100755
--- a/loadbars
+++ b/loadbars
@@ -146,18 +146,20 @@ sub read_config () {
while (<$conffile>) {
chomp;
- next if /^[\t\s]*#/;
- s/[\t\s]*#.*//;
+ s/[\t\s]*?#.*//;
next unless length;
- my ($key, $val) = split /=/, $_;
- trim $key; trim $val;
+ my ($key, $val) = split '=';
unless (defined $val) {
display_warn "Could not parse config line: $_";
+ next;
+ }
+
+ trim $key; trim $val;
- } elsif (not exists $C{$key}) {
+ if (not exists $C{$key}) {
display_warn "There is no such config key: $key, ignoring";
} else {