win32/sspi: Fix Win32::SSPI::SSPIResult#== with Integer

The values of `@@map` are `Symbol`s and `@value` should be an
`Integer` since unpacked as unsigned long, so this comparison should
be false always.  Probably comparison with `Symbol` was intended.
This commit is contained in:
Nobuyoshi Nakada 2024-05-03 22:24:44 +09:00
parent 1179c86384
commit b7bca0ebdc
No known key found for this signature in database
GPG key ID: 3582D74E1FEE4465
Notes: git 2024-09-29 12:34:34 +00:00

View file

@ -202,10 +202,13 @@ module Win32
end end
def ==(other) def ==(other)
if other.is_a?(SSPIResult) case other
when SSPIResult
@value == other.value @value == other.value
elsif other.is_a?(Integer) when Integer
@value == @@map[other] @value == other
when Symbol
@@map[@value] == other
else else
false false
end end