Diff for sendxmpp/sendxmpp between version 1.8 and 1.9
version 1.8, 2007/03/03 12:58:35 |
version 1.9, 2007/03/03 15:35:44 |
Line 134 sub read_config_file ($) { |
|
Line 134 sub read_config_file ($) { |
|
|
|
my %config; |
my %config; |
my $line = 0; |
my $line = 0; |
while (<CFG>) { |
while (<CFG>) { |
|
|
++$line; |
++$line; |
|
|
next if (/^\s*$/); # ignore empty lines |
next if (/^\s*$/); # ignore empty lines |
next if (/^\s*\#.*/); # ignore comment lines |
next if (/^\s*\#.*/); # ignore comment lines |
|
|
s/\#.*$//; # ignore comments in lines |
#s/\#.*$//; # ignore comments in lines |
|
|
# Hugo van der Kooij <hvdkooij AT vanderkooij.org> has ccount with '#' as username |
# Hugo van der Kooij <hvdkooij AT vanderkooij.org> has ccount with '#' as username |
if (/([-\.\w_#]+)@([-\.\w:]+)\s+(\S+)\s*$/) { |
if (/^([\.\w_#-]+)@([-\.\w:]+)\s+(\S+)\s*/) { |
%config = ('username' => $1, |
%config = ('username' => $1, |
'jserver' => $2, |
'jserver' => $2, |
'port' => 0, |
'port' => 0, |
'password' => $3); |
'password' => $3); |
|
|
if ($config{'jserver'} =~ /(.*):(\d+)/) { |
if ($config{'jserver'} =~ /(.*):(\d+)/) { |
$config{'jserver'} = $1; |
$config{'jserver'} = $1; |
$config{'port'} = $2; |
$config{'port'} = $2; |
} |
} |
} else { |
} |
close CFG; |
else { |
error_exit ("syntax error in line $line of $cfg_file"); |
close CFG; |
|
error_exit ("syntax error in line $line of $cfg_file"); |
|
} |
} |
} |
} |
|
|
|
close CFG; |
close CFG; |
|
|
Platon Group <platon@platon.org> http://platon.org/
|
|