aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-11-05 16:29:27 -0500
committerJustin M. Keyes <justinkz@gmail.com>2015-11-05 16:29:27 -0500
commitdd087ea9c94d33c2a28f5859bebdcaed0872d096 (patch)
treef6ca8b592d79f57cf1d81e7fd869a210d7565db5
parente19f1c54914527da7a20d49905ed1c1b95eb9ceb (diff)
parent96dc38b3c84378e5869e030e0a1854e10f2c0a28 (diff)
downloadrneovim-dd087ea9c94d33c2a28f5859bebdcaed0872d096.tar.gz
rneovim-dd087ea9c94d33c2a28f5859bebdcaed0872d096.tar.bz2
rneovim-dd087ea9c94d33c2a28f5859bebdcaed0872d096.zip
Merge pull request #3607 from ZyX-I/fix-3605
undo: Remove incorrect NONNULL_ALL attribute
-rw-r--r--src/nvim/undo.c2
-rw-r--r--test/functional/ex_cmds/wundo_spec.lua17
2 files changed, 14 insertions, 5 deletions
diff --git a/src/nvim/undo.c b/src/nvim/undo.c
index d8158bf7cd..b0c49cbf8e 100644
--- a/src/nvim/undo.c
+++ b/src/nvim/undo.c
@@ -650,7 +650,7 @@ void u_compute_hash(char_u *hash)
///
/// @return [allocated] File name to read from/write to or NULL.
char *u_get_undo_file_name(const char *const buf_ffname, const bool reading)
- FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
+ FUNC_ATTR_WARN_UNUSED_RESULT
{
char *dirp;
char dir_name[MAXPATHL + 1];
diff --git a/test/functional/ex_cmds/wundo_spec.lua b/test/functional/ex_cmds/wundo_spec.lua
index d8bd8a7031..c3147e1c0f 100644
--- a/test/functional/ex_cmds/wundo_spec.lua
+++ b/test/functional/ex_cmds/wundo_spec.lua
@@ -1,9 +1,9 @@
--- Specs for
--- :wundo
+-- Specs for :wundo and underlying functions
local helpers = require('test.functional.helpers')
-local execute, eq, clear, eval, feed =
- helpers.execute, helpers.eq, helpers.clear, helpers.eval, helpers.feed
+local execute, clear, eval, feed, spawn, nvim_prog, set_session =
+ helpers.execute, helpers.clear, helpers.eval, helpers.feed, helpers.spawn,
+ helpers.nvim_prog, helpers.set_session
describe(':wundo', function()
@@ -16,5 +16,14 @@ describe(':wundo', function()
os.remove(eval('getcwd()') .. '/foo') --cleanup
end)
+end)
+describe('u_* functions', function()
+ it('safely fail on new, non-empty buffer', function()
+ local session = spawn({nvim_prog, '-u', 'NONE', '-i', 'NONE', '--embed',
+ '-c', 'set undodir=. undofile'})
+ set_session(session)
+ execute('echo "True"') -- Should not error out due to crashed Neovim
+ session:exit(0)
+ end)
end)