diff options
| author | Paul Buetow <paul@buetow.org> | 2012-02-05 00:15:15 +0100 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2012-02-05 00:15:15 +0100 |
| commit | 7c48c5216f13fe80dd5c0a44e96da95d8162e684 (patch) | |
| tree | 001bd322a82be69f8c294abd9422b6ed2ce0988f | |
| parent | df78a4694c9bb215f27c22f5f3b325462665e968 (diff) | |
Some read_config bugs fixed
| -rwxr-xr-x | loadbars | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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 { |
