[ruby/digest] Fix --without-common-digest option

In `digest_conf`, "no implicit conversion of false into String"
TypeError is raised.

https://github.com/ruby/digest/commit/89e5e5fe3a
This commit is contained in:
Nobuyoshi Nakada 2024-11-07 11:00:25 +09:00 committed by git
parent 430789dec4
commit ba6a36e653

View File

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