Fix some option handling for servers
authorpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Wed, 12 Sep 2007 21:55:07 +0000 (21:55 +0000)
committerpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Wed, 12 Sep 2007 21:55:07 +0000 (21:55 +0000)
git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@27 088b83a4-0077-4247-935c-42ec02c2848b

core.pl

diff --git a/core.pl b/core.pl
index 63b6249..3545c0a 100644 (file)
--- a/core.pl
+++ b/core.pl
@@ -112,12 +112,12 @@ sub on_start {
        $kernel->alias_set( "core" );
        print( "CORE: Started.\n" );
        for my $server ( split( / /, $Destult::config{ 'SERVERS' } ) ) {
-               $server =~ m'([^:]+)://([^/]+)(/[^/]+)*'i;
-               my( $prot, $host, $opts ) = ( $1, $2, $3 );
-               print( "Connect to $host over $prot: $opts\n" );
+               $server =~ m'([^:]+)://(.*)'i;
+               my( $prot, $rest ) = ( $1, $2 );
+               my( $host, $opts ) = split( '/', $rest, 2 );
+               print( "CORE: Connect to $host over $prot: $opts\n" );
                if( $prot =~ /irc/i ) {
                        my @opts = split( '/', $opts );
-                       shift @opts;
                        push @{ $heap->{ 'servers' } }, irc::new( $host, shift @opts, @opts );
                } else {
                        die( "CORE: Unknown protocol: '$prot'" );