diff options
author | ZyX <kp-pav@yandex.ru> | 2016-09-05 10:16:56 +0300 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-09-04 21:45:48 -0400 |
commit | 6127eaef0534d1ff5b96b8ed15854b4bedf8e9b4 (patch) | |
tree | d0fde734dac4ec478db6aa0e04b682aa16d89634 /test/functional/shada/helpers.lua | |
parent | cd321b7d0fb161b77cd7b25da7f9a4721cfb0110 (diff) | |
download | rneovim-6127eaef0534d1ff5b96b8ed15854b4bedf8e9b4.tar.gz rneovim-6127eaef0534d1ff5b96b8ed15854b4bedf8e9b4.tar.bz2 rneovim-6127eaef0534d1ff5b96b8ed15854b4bedf8e9b4.zip |
shada: Fix non-writeable ShaDa directory handling
Before this change,
nvim -i /etc/shada
segfaults on exit if the file does not exist and user does not have
permissions to create the file at /etc/shada.
Closes #5296
Reported in #5277
https://github.com/neovim/neovim/issues/5277#issuecomment-243937255
Diffstat (limited to 'test/functional/shada/helpers.lua')
-rw-r--r-- | test/functional/shada/helpers.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/functional/shada/helpers.lua b/test/functional/shada/helpers.lua index cde555f0a7..8e2c0cc1f6 100644 --- a/test/functional/shada/helpers.lua +++ b/test/functional/shada/helpers.lua @@ -8,8 +8,8 @@ local mpack = require('mpack') local tmpname = helpers.tmpname() local additional_cmd = '' -local function nvim_argv() - local argv = {nvim_prog, '-u', 'NONE', '-i', tmpname, '-N', +local function nvim_argv(shada_file) + local argv = {nvim_prog, '-u', 'NONE', '-i', shada_file or tmpname, '-N', '--cmd', 'set shortmess+=I background=light noswapfile', '--cmd', additional_cmd, '--embed'} @@ -20,8 +20,8 @@ local function nvim_argv() end end -local reset = function() - set_session(spawn(nvim_argv())) +local reset = function(shada_file) + set_session(spawn(nvim_argv(shada_file))) meths.set_var('tmpname', tmpname) end |