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

Fix a few compiler warnings. Fix crash with encrypted undo file.

This commit is contained in:
Bram Moolenaar
2010-06-06 14:20:26 +02:00
parent 860cae1cec
commit 56be950094
10 changed files with 37 additions and 6 deletions

View File

@@ -1503,13 +1503,19 @@ u_read_undo(name, hash, orig_name)
if (version == UF_VERSION_CRYPT)
{
#ifdef FEAT_CRYPT
if (*curbuf->b_p_key == NUL)
{
EMSG2(_("E832: Non-encrypted file has encrypted undo file: %s"),
file_name);
goto error;
}
if (prepare_crypt_read(fp) == FAIL)
{
EMSG2(_("E826: Undo file decryption failed: %s"), file_name);
goto error;
}
#else
EMSG2(_("E826: Undo file is encrypted: %s"), file_name);
EMSG2(_("E827: Undo file is encrypted: %s"), file_name);
goto error;
#endif
}