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:
Nicolas Hillegeer
2014-07-22 21:10:12 +02:00
committed by Thiago de Arruda
parent ad4c1e1954
commit 1cfc468e5c

View File

@@ -88,9 +88,9 @@ cimport './src/nvim/types.h'
-- take a pointer to a C-allocated string and return an interned
-- version while also freeing the memory
internalize = (cdata) ->
internalize = (cdata, len) ->
ffi.gc cdata, ffi.C.free
return ffi.string cdata
return ffi.string cdata, len
cstr = ffi.typeof 'char[?]'