mirror of
https://github.com/duncs/clusterssh.git
synced 2025-07-02 01:21:14 +00:00
Fix for parsing config files with empty values
Thanks to Stefan Steiner
This commit is contained in:
parent
5de65fbf77
commit
69a51ae54c
4 changed files with 13 additions and 5 deletions
|
@ -3,7 +3,7 @@ package App::ClusterSSH;
|
|||
use 5.008.004;
|
||||
use warnings;
|
||||
use strict;
|
||||
use version; our $VERSION = version->new('4.00_06');
|
||||
use version; our $VERSION = version->new('4.00_07');
|
||||
|
||||
use Carp;
|
||||
|
||||
|
@ -269,6 +269,8 @@ sub parse_config_file($) {
|
|||
; # ignore blank lines & commented lines
|
||||
$l =~ s/#.*//; # remove comments from remaining lines
|
||||
$l =~ s/\s*$//; # remove trailing whitespace
|
||||
|
||||
# look for continuation lines
|
||||
chomp $l;
|
||||
if ( $l =~ s/\\\s*$// ) {
|
||||
$l .= <CFG>;
|
||||
|
@ -277,8 +279,10 @@ sub parse_config_file($) {
|
|||
|
||||
next unless $l =~ m/\s*(\S+)\s*=\s*(.*)\s*/;
|
||||
my ( $key, $value ) = ( $1, $2 );
|
||||
$config{$key} = $value;
|
||||
logmsg( 3, "$key=$value" );
|
||||
if ( defined $key && defined $value ) {
|
||||
$config{$key} = $value;
|
||||
logmsg( 3, "$key=$value" );
|
||||
}
|
||||
}
|
||||
close(CFG);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue