mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 00:08:19 +00:00
eval: Fix len argument to xstrlcat
This commit is contained in:
@@ -13432,7 +13432,7 @@ static void f_resolve(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
const size_t p_len = strlen(p);
|
const size_t p_len = strlen(p);
|
||||||
cpy = xmallocz(p_len + len);
|
cpy = xmallocz(p_len + len);
|
||||||
memcpy(cpy, p, p_len + 1);
|
memcpy(cpy, p, p_len + 1);
|
||||||
xstrlcat(cpy + p_len, remain, len);
|
xstrlcat(cpy + p_len, remain, len + 1);
|
||||||
xfree(p);
|
xfree(p);
|
||||||
p = cpy;
|
p = cpy;
|
||||||
|
|
||||||
|
@@ -180,8 +180,7 @@ describe('ShaDa support code', function()
|
|||||||
nvim_command('undo')
|
nvim_command('undo')
|
||||||
nvim_command('set shada+=%')
|
nvim_command('set shada+=%')
|
||||||
nvim_command('wshada! ' .. shada_fname)
|
nvim_command('wshada! ' .. shada_fname)
|
||||||
local readme_fname = paths.test_source_path .. '/README.md'
|
local readme_fname = funcs.resolve(paths.test_source_path) .. '/README.md'
|
||||||
readme_fname = helpers.eval( 'resolve("' .. readme_fname .. '")' )
|
|
||||||
eq({[7]=1, [8]=2, [9]=1, [10]=4, [11]=1}, find_file(readme_fname))
|
eq({[7]=1, [8]=2, [9]=1, [10]=4, [11]=1}, find_file(readme_fname))
|
||||||
nvim_command('set shada+=r~')
|
nvim_command('set shada+=r~')
|
||||||
nvim_command('wshada! ' .. shada_fname)
|
nvim_command('wshada! ' .. shada_fname)
|
||||||
@@ -189,7 +188,8 @@ describe('ShaDa support code', function()
|
|||||||
nvim_command('set shada-=r~')
|
nvim_command('set shada-=r~')
|
||||||
nvim_command('wshada! ' .. shada_fname)
|
nvim_command('wshada! ' .. shada_fname)
|
||||||
eq({[7]=1, [8]=2, [9]=1, [10]=4, [11]=1}, find_file(readme_fname))
|
eq({[7]=1, [8]=2, [9]=1, [10]=4, [11]=1}, find_file(readme_fname))
|
||||||
nvim_command('set shada+=r' .. paths.test_source_path)
|
nvim_command('set shada+=r' .. funcs.escape(
|
||||||
|
funcs.escape(paths.test_source_path, '$~'), ' "\\,'))
|
||||||
nvim_command('wshada! ' .. shada_fname)
|
nvim_command('wshada! ' .. shada_fname)
|
||||||
eq({}, find_file(readme_fname))
|
eq({}, find_file(readme_fname))
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user