Skip to content

Commit

Permalink
Fix --without-common-digest option
Browse files Browse the repository at this point in the history
In `digest_conf`, "no implicit conversion of false into String"
TypeError is raised.
  • Loading branch information
nobu committed Nov 7, 2024
1 parent 008c3f4 commit 89e5e5f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions ext/digest/digest_conf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

def digest_conf(name)
unless with_config("bundled-#{name}")
cc = with_config("common-digest")
if cc != false or /\b#{name}\b/ =~ cc
if File.exist?("#$srcdir/#{name}cc.h") and
have_header("CommonCrypto/CommonDigest.h")
$defs << "-D#{name.upcase}_USE_COMMONDIGEST"
$headers << "#{name}cc.h"
return :commondigest
end
case cc = with_config("common-digest", true)
when true, false
else
cc = cc.split(/[\s,]++/).any? {|pat| File.fnmatch?(pat, name)}
end
if cc and File.exist?("#$srcdir/#{name}cc.h") and
have_header("CommonCrypto/CommonDigest.h")
$defs << "-D#{name.upcase}_USE_COMMONDIGEST"
$headers << "#{name}cc.h"
return :commondigest
end
end
$objs << "#{name}.#{$OBJEXT}"
Expand Down

0 comments on commit 89e5e5f

Please sign in to comment.