aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-04-09 21:47:45 +0300
committerZyX <kp-pav@yandex.ru>2017-04-09 22:02:51 +0300
commit5b4f07ee86194a7c6032991102c96387581029c9 (patch)
treee2e5a30962a0e86ce704a0d8853cce1698261f52
parent8d982ab52269e8adccbc21cc0d6f8ab3b817bf6e (diff)
downloadrneovim-5b4f07ee86194a7c6032991102c96387581029c9.tar.gz
rneovim-5b4f07ee86194a7c6032991102c96387581029c9.tar.bz2
rneovim-5b4f07ee86194a7c6032991102c96387581029c9.zip
spellfile: Use old error
This makes first test not actually show any change in behaviour.
-rw-r--r--src/nvim/spellfile.c2
-rw-r--r--test/functional/spell/spellfile_spec.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c
index 2c0db0694a..4909b7b14e 100644
--- a/src/nvim/spellfile.c
+++ b/src/nvim/spellfile.c
@@ -1006,7 +1006,7 @@ static int read_prefcond_section(FILE *fd, slang_T *lp)
buf[0] = '^'; // always match at one position only
const size_t read_byte = fread(buf + 1, 1, (size_t)n, fd);
if (read_byte != (size_t)n) {
- return feof(fd) ? SP_FORMERROR : SP_OTHERERROR;
+ return feof(fd) ? SP_TRUNCERROR : SP_OTHERERROR;
}
if (memchr(buf + 1, NUL, (size_t)n)) {
return SP_FORMERROR;
diff --git a/test/functional/spell/spellfile_spec.lua b/test/functional/spell/spellfile_spec.lua
index 88f757249e..e7ad79c009 100644
--- a/test/functional/spell/spellfile_spec.lua
+++ b/test/functional/spell/spellfile_spec.lua
@@ -34,7 +34,7 @@ describe('spellfile', function()
-- │ │ ┌ Condition regex (missing!)
.. '\000\001\001')
meths.set_option('spelllang', 'en')
- eq('Vim(set):E759: Format error in spell file',
+ eq('Vim(set):E758: Truncated spell file',
exc_exec('set spell'))
end)
it('errors out when prefcond regexp contains NUL byte', function()