OSDN Git Service

*** empty log message ***
authormorimoto <morimoto@180c8125-5b33-4295-ad04-72a68a15b4cc>
Sat, 2 Aug 2008 17:54:03 +0000 (17:54 +0000)
committermorimoto <morimoto@180c8125-5b33-4295-ad04-72a68a15b4cc>
Sat, 2 Aug 2008 17:54:03 +0000 (17:54 +0000)
lib/Keitairc/Config.pm

index fe9eed6..611b7bf 100644 (file)
@@ -1,6 +1,6 @@
 # -*- mode: perl; coding: utf-8 -*-
 # Keitairc::Config
-# $Id: Config.pm,v 1.18 2008-08-02 15:02:15 morimoto Exp $
+# $Id: Config.pm,v 1.19 2008-08-02 17:54:03 morimoto Exp $
 # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/Keitairc/Config.pm,v $
 #
 # Copyright (c) 2008 Jun Morimoto <morimoto@mrmt.net>
@@ -69,12 +69,10 @@ sub new{
        $me->debug(0);
 
        if(defined $argv[0]){
-               unless(-r $argv[0]){
-                       Keitairc::Log::log("Can't read $argv[0]");
-                       exit 1;
+               if(-r $argv[0]){
+                       $me->file($argv[0]);
+                       shift(@argv);
                }
-               $me->file($argv[0]);
-               shift(@argv);
        }else{
                $me->file('/etc/keitairc');
                $me->file($ENV{HOME} . '/.keitairc');
@@ -99,27 +97,27 @@ sub new{
                Keitairc::Log::log('au_pcsv has obsoleted from keitairc 2.0');
        }
 
-       unless(length $me->irc_nick()){
+       if(!defined($me->irc_nick()) || !length($me->irc_nick())){
                Keitairc::Log::log_die('irc_nick does not specified');
        }
 
-       unless(length $me->irc_username()){
+       if(!defined($me->irc_username()) || !length($me->irc_username())){
                Keitairc::Log::log_die('irc_username does not specified');
        }
 
-       unless(length $me->irc_server()){
+       if(!defined($me->irc_server()) || !length($me->irc_server())){
                Keitairc::Log::log_die('irc_server does not specified');
        }
 
-       unless(length $me->web_port()){
+       if(!defined($me->web_port()) || !length($me->web_port())){
                Keitairc::Log::log_die('web_port does not specified');
        }
 
-       unless(length $me->web_host()){
+       if(!defined($me->web_host()) || !length($me->web_host())){
                Keitairc::Log::log_die('web_host does not specified');
        }
 
-       unless(length $me->web_password()){
+       if(!defined($me->web_password()) || !length($me->web_password())){
                Keitairc::Log::log_die('web_password does not specified');
        }