diff options
author | Russ Allbery <rra@stanford.edu> | 2007-08-31 06:52:37 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2007-08-31 06:52:37 +0000 |
commit | d65a031443ce1a87102b8ac966f22d739b23c335 (patch) | |
tree | fdb63a07318038ad52fbe3f569e9f39a7e26e316 /perl/Wallet/Server.pm | |
parent | 03de6cb922b4e54b47af7bbbd9421d6140c8dfdb (diff) |
Allow empty DB_INFO and DB_NAME settings as long as they're defined.
Diffstat (limited to 'perl/Wallet/Server.pm')
-rw-r--r-- | perl/Wallet/Server.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/perl/Wallet/Server.pm b/perl/Wallet/Server.pm index e7a419f..6bf4251 100644 --- a/perl/Wallet/Server.pm +++ b/perl/Wallet/Server.pm @@ -43,11 +43,12 @@ $VERSION = '0.01'; sub _open_db { my ($class) = @_; unless ($Wallet::Config::DB_DRIVER - and ($Wallet::Config::DB_INFO or $Wallet::Config::DB_NAME)) { + and (defined ($Wallet::Config::DB_INFO) + or defined ($Wallet::Config::DB_NAME))) { die "database connection information not configured\n"; } my $dsn = "DBI:$Wallet::Config::DB_DRIVER:"; - if ($Wallet::Config::DB_INFO) { + if (defined $Wallet::Config::DB_INFO) { $dsn .= $Wallet::Config::DB_INFO; } else { $dsn .= "database=$Wallet::Config::DB_NAME"; |