mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
eval: Fix len argument to xstrlcat
This commit is contained in:
parent
2c8ad27652
commit
cdb1aa3e47
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user