Skip to content

Commit

Permalink
Revert "windows.rb: can call win32api using nil as NULL for pointer a…
Browse files Browse the repository at this point in the history
…rgument"

This reverts commit 93a23bc.
  • Loading branch information
YO4 committed Nov 7, 2024
1 parent eb5959c commit 5443ab5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/reline/io/windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def initialize(dllname, func, import, export = "0", calltype = :stdcall)
def call(*args)
import = @proto.split("")
args.each_with_index do |x, i|
args[i], = [x == 0 ? nil : x&.+@].pack("p").unpack(POINTER_TYPE) if import[i] == "S"
args[i], = [x == 0 ? nil : +x].pack("p").unpack(POINTER_TYPE) if import[i] == "S"
args[i], = [x].pack("I").unpack("i") if import[i] == "I"
end
ret, = @func.call(*args)
Expand Down

0 comments on commit 5443ab5

Please sign in to comment.