diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-09-12 20:25:24 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-09-12 20:25:24 +0000 |
commit | ac2adc79f79b75fcbfe2257cd013b2a5d02d99db (patch) | |
tree | 7cb0a180d879361482fae3eb266975a54d47ec46 | |
parent | 2113a1d623130aab59f020ba376b1793a16fb20f (diff) | |
download | vim-git-7.0.101.tar.gz |
updated for version 7.0-101v7.0.101
-rw-r--r-- | src/spell.c | 13 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/spell.c b/src/spell.c index a79453ea3..a6581af1d 100644 --- a/src/spell.c +++ b/src/spell.c @@ -9347,20 +9347,27 @@ spell_add_word(word, len, bad, idx, undo) fclose(fd); } } - else + + if (!undo) { fd = mch_fopen((char *)fname, "a"); if (fd == NULL && new_spf) { + char_u *p; + /* We just initialized the 'spellfile' option and can't open the * file. We may need to create the "spell" directory first. We * already checked the runtime directory is writable in * init_spellfile(). */ - if (!dir_of_file_exists(fname)) + if (!dir_of_file_exists(fname) && (p = gettail_sep(fname)) != fname) { + int c = *p; + /* The directory doesn't exist. Try creating it and opening * the file again. */ - vim_mkdir(NameBuff, 0755); + *p = NUL; + vim_mkdir(fname, 0755); + *p = c; fd = mch_fopen((char *)fname, "a"); } } diff --git a/src/version.c b/src/version.c index c170e1530..2565b7ab9 100644 --- a/src/version.c +++ b/src/version.c @@ -667,6 +667,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 101, +/**/ 100, /**/ 99, |