summaryrefslogtreecommitdiff
path: root/perl
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2007-08-31 06:52:37 +0000
committerRuss Allbery <rra@stanford.edu>2007-08-31 06:52:37 +0000
commitd65a031443ce1a87102b8ac966f22d739b23c335 (patch)
treefdb63a07318038ad52fbe3f569e9f39a7e26e316 /perl
parent03de6cb922b4e54b47af7bbbd9421d6140c8dfdb (diff)
Allow empty DB_INFO and DB_NAME settings as long as they're defined.
Diffstat (limited to 'perl')
-rw-r--r--perl/Wallet/Server.pm5
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";