RHEL requires the source code for dependencies to be included in the srpm. The spec file already expects that, but we've only included the vendored modules (i.e., the `vendor` directory) in the `rhel-8.2.` branch. Move vendoring to master, so that we can build RHEL packages from it as well. This commit is the result of running `go mod vendor`, which includes the vendored sources and updates go.mod and go.sum files. Fedora requires the opposite: dependencies should not be vendored. The spec file already ignores the `vendor` directory by default.
23 lines
350 B
Go
23 lines
350 B
Go
package ieproxy
|
|
|
|
import (
|
|
"unicode/utf16"
|
|
"unsafe"
|
|
)
|
|
|
|
// StringFromUTF16Ptr converts a *uint16 C string to a Go String
|
|
func StringFromUTF16Ptr(s *uint16) string {
|
|
if s == nil {
|
|
return ""
|
|
}
|
|
|
|
p := (*[1<<30 - 1]uint16)(unsafe.Pointer(s))
|
|
|
|
// find the string length
|
|
sz := 0
|
|
for p[sz] != 0 {
|
|
sz++
|
|
}
|
|
|
|
return string(utf16.Decode(p[:sz:sz]))
|
|
}
|