0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

Fix: editing a not encrypted file after a crypted file messed up reading the

text from an undo file.
This commit is contained in:
Bram Moolenaar
2010-07-25 16:05:19 +02:00
parent 8d9b40e71a
commit fa0ff9aedf
3 changed files with 6 additions and 6 deletions

View File

@@ -2953,7 +2953,7 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
}
/* When starting to edit a new file which does not have encryption, clear
* the 'key' option, except when starting up (called with -x argument) */
else if (newfile && *curbuf->b_p_key && !starting)
else if (newfile && *curbuf->b_p_key != NUL && !starting)
set_option_value((char_u *)"key", 0L, (char_u *)"", OPT_LOCAL);
return cryptkey;