Enable Ruby to run on Windows with frozen string literals

This commit is contained in:
Sam Aaron 2024-04-26 16:10:42 +01:00 committed by GitHub
parent 69c1bd90be
commit 67b79d484f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -318,7 +318,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
size = packdw(0)
name = make_wstr(name)
check RegQueryValueExW.call(hkey, name, 0, type, 0, size)
data = "\0".force_encoding('ASCII-8BIT') * unpackdw(size)
data = "\0".b * unpackdw(size)
check RegQueryValueExW.call(hkey, name, 0, type, data, size)
[ unpackdw(type), data[0, unpackdw(size)] ]
end