aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/spellfile.c
diff options
context:
space:
mode:
authorMatthieu Coudron <mattator@gmail.com>2020-07-06 23:31:24 +0200
committerGitHub <noreply@github.com>2020-07-06 23:31:24 +0200
commite49fc4ba1f27d968b2a104a14633459ad6091ca3 (patch)
treeee3d32344ec0cba95c64c76169c9607e9a94d72d /src/nvim/spellfile.c
parent4ab7bbf3eaeacc32e8970b76a19c8682f98cc183 (diff)
parent10c563577cc11b0af4c465a68f17b0a8976631f8 (diff)
downloadrneovim-e49fc4ba1f27d968b2a104a14633459ad6091ca3.tar.gz
rneovim-e49fc4ba1f27d968b2a104a14633459ad6091ca3.tar.bz2
rneovim-e49fc4ba1f27d968b2a104a14633459ad6091ca3.zip
Merge pull request #12538 from janlazo/vim-8.2.1055
vim-patch:8.1.{93,1372},8.2.{1055,1060,1089,1095,1104}
Diffstat (limited to 'src/nvim/spellfile.c')
-rw-r--r--src/nvim/spellfile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c
index f8c10d0258..41669789db 100644
--- a/src/nvim/spellfile.c
+++ b/src/nvim/spellfile.c
@@ -5095,7 +5095,8 @@ mkspell (
spin.si_newcompID = 127; // start compound ID at first maximum
// default: fnames[0] is output file, following are input files
- innames = &fnames[1];
+ // When "fcount" is 1 there is only one file.
+ innames = &fnames[fcount == 1 ? 0 : 1];
incount = fcount - 1;
wfname = xmalloc(MAXPATHL);
@@ -5105,12 +5106,10 @@ mkspell (
if (fcount == 1 && len > 4 && STRCMP(fnames[0] + len - 4, ".add") == 0) {
// For ":mkspell path/en.latin1.add" output file is
// "path/en.latin1.add.spl".
- innames = &fnames[0];
incount = 1;
vim_snprintf((char *)wfname, MAXPATHL, "%s.spl", fnames[0]);
} else if (fcount == 1) {
// For ":mkspell path/vim" output file is "path/vim.latin1.spl".
- innames = &fnames[0];
incount = 1;
vim_snprintf((char *)wfname, MAXPATHL, SPL_FNAME_TMPL,
fnames[0], spin.si_ascii ? (char_u *)"ascii" : spell_enc());