summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-12 08:01:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-12 08:01:51 +0000
commit521f420a772c37cd4a90b51da7c18c18084c47ac (patch)
treed4f62cf751ae28840229d7389e22e8707a6b5f62
parent0eb08aa068abc9101d1452ce868126575782b471 (diff)
* ext/dbm/extconf.rb (headers.db_check): reduce duplicated code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--ext/dbm/extconf.rb4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d95d619..5cd3510 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sat Nov 12 17:01:49 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/dbm/extconf.rb (headers.db_check): reduce duplicated code.
+
Sat Nov 12 15:59:42 2011 Tanaka Akira <akr@fsij.org>
* ext/dbm/extconf.rb: dbm_clearerr should be available in all ndbm
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index 2fc5c44..b46688a 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -39,8 +39,8 @@ def headers.db_check(db)
have_library("gdbm") or return false
end
- if (hdr = self.fetch(db, ["ndbm.h"]).find {|h| have_type("DBM", h, hsearch)} or
- hdr = self.fetch(db, ["ndbm.h"]).find {|h| have_type("DBM", ["db.h", h], hsearch)}) and
+ hdrs = self.fetch(db, ["ndbm.h"])
+ if (hdr = hdrs.find {|h| have_type("DBM", h, hsearch)} || hdrs.find {|h| have_type("DBM", ["db.h", h], hsearch)}) and
(have_library(db, 'dbm_open("", 0, 0)', hdr, hsearch) || have_func('dbm_open("", 0, 0)', hdr, hsearch)) and
have_func('dbm_clearerr((DBM *)0)', hdr, hsearch)
if hsearch