mirror of
https://github.com/neovim/neovim.git
synced 2025-12-03 07:23:05 +00:00
test/helpers: allow interning Pascal strings
os_system() returns a Pascal string, for example (it also NUL-terminates the string, but that's neither here nor there).
This commit is contained in:
committed by
Thiago de Arruda
parent
ad4c1e1954
commit
1cfc468e5c
@@ -88,9 +88,9 @@ cimport './src/nvim/types.h'
|
|||||||
|
|
||||||
-- take a pointer to a C-allocated string and return an interned
|
-- take a pointer to a C-allocated string and return an interned
|
||||||
-- version while also freeing the memory
|
-- version while also freeing the memory
|
||||||
internalize = (cdata) ->
|
internalize = (cdata, len) ->
|
||||||
ffi.gc cdata, ffi.C.free
|
ffi.gc cdata, ffi.C.free
|
||||||
return ffi.string cdata
|
return ffi.string cdata, len
|
||||||
|
|
||||||
cstr = ffi.typeof 'char[?]'
|
cstr = ffi.typeof 'char[?]'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user