A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neovim/neovim/commit/f6cc604af2a4d95ec9bcaa5bee705cec2e06d541 below:

convert blob to NUL-terminated API string · neovim/neovim@f6cc604 · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+8

-1

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+8

-1

lines changed Original file line number Diff line number Diff line change

@@ -57,7 +57,7 @@ typedef struct {

57 57

const size_t len_ = (size_t)(len); \

58 58

const blob_T *const blob_ = (blob); \

59 59

kvi_push(edata->stack, STRING_OBJ(((String) { \

60 -

.data = len_ != 0 ? xmemdup(blob_->bv_ga.ga_data, len_) : NULL, \

60 +

.data = len_ != 0 ? xmemdupz(blob_->bv_ga.ga_data, len_) : xstrdup(""), \

61 61

.size = len_ \

62 62

}))); \

63 63

} while (0)

Original file line number Diff line number Diff line change

@@ -102,6 +102,13 @@ describe('luaeval(vim.api.…)', function()

102 102

eq(false, funcs.luaeval('vim.api.nvim__id(false)'))

103 103

eq(NIL, funcs.luaeval('vim.api.nvim__id(nil)'))

104 104 105 +

-- API strings from Blobs can work as NUL-terminated C strings

106 +

eq('Vim(call):E5555: API call: Vim:E15: Invalid expression: ',

107 +

exc_exec('call nvim_eval(v:_null_blob)'))

108 +

eq('Vim(call):E5555: API call: Vim:E15: Invalid expression: ',

109 +

exc_exec('call nvim_eval(0z)'))

110 +

eq(1, eval('nvim_eval(0z31)'))

111 + 105 112

eq(0, eval([[type(luaeval('vim.api.nvim__id(1)'))]]))

106 113

eq(1, eval([[type(luaeval('vim.api.nvim__id("1")'))]]))

107 114

eq(3, eval([[type(luaeval('vim.api.nvim__id({1})'))]]))

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4