diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-06-06 14:20:26 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-06-06 14:20:26 +0200 |
commit | 56be950094e10e68da1f901ba971c5f3e9821685 (patch) | |
tree | 9b77adba1105bac626534bfa85c5d72e187f53ac /src/undo.c | |
parent | 860cae1cec85aeb06668a2b071727c43869acf15 (diff) | |
download | vim-git-56be950094e10e68da1f901ba971c5f3e9821685.tar.gz |
Fix a few compiler warnings. Fix crash with encrypted undo file.
Diffstat (limited to 'src/undo.c')
-rw-r--r-- | src/undo.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/undo.c b/src/undo.c index 232dbac48..22d07d501 100644 --- a/src/undo.c +++ b/src/undo.c @@ -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 } |