comparison src/undo.c @ 2251:646d34788036 vim73

Fix a few compiler warnings. Fix crash with encrypted undo file.
author Bram Moolenaar <bram@vim.org>
date Sun, 06 Jun 2010 14:20:26 +0200
parents 4e0124f5aee2
children 771f21e35ec5
comparison
equal deleted inserted replaced
2250:1bac28a53fae 2251:646d34788036
1501 } 1501 }
1502 version = get2c(fp); 1502 version = get2c(fp);
1503 if (version == UF_VERSION_CRYPT) 1503 if (version == UF_VERSION_CRYPT)
1504 { 1504 {
1505 #ifdef FEAT_CRYPT 1505 #ifdef FEAT_CRYPT
1506 if (*curbuf->b_p_key == NUL)
1507 {
1508 EMSG2(_("E832: Non-encrypted file has encrypted undo file: %s"),
1509 file_name);
1510 goto error;
1511 }
1506 if (prepare_crypt_read(fp) == FAIL) 1512 if (prepare_crypt_read(fp) == FAIL)
1507 { 1513 {
1508 EMSG2(_("E826: Undo file decryption failed: %s"), file_name); 1514 EMSG2(_("E826: Undo file decryption failed: %s"), file_name);
1509 goto error; 1515 goto error;
1510 } 1516 }
1511 #else 1517 #else
1512 EMSG2(_("E826: Undo file is encrypted: %s"), file_name); 1518 EMSG2(_("E827: Undo file is encrypted: %s"), file_name);
1513 goto error; 1519 goto error;
1514 #endif 1520 #endif
1515 } 1521 }
1516 else if (version != UF_VERSION) 1522 else if (version != UF_VERSION)
1517 { 1523 {