comparison src/memline.c @ 24990:85d1e82ed134 v8.2.3032

patch 8.2.3032: build problems with MSVC, other crypt issues with libsodium Commit: https://github.com/vim/vim/commit/226b28b96150e59375d2bff44e0aadd382b0c3f1 Author: Christian Brabandt <cb@256bit.org> Date: Mon Jun 21 21:08:08 2021 +0200 patch 8.2.3032: build problems with MSVC, other crypt issues with libsodium Problem: Build problems with MSVC, other crypt issues with libsodium. Solution: Adjust MSVC makefile. Disable swap file only when 'key' is set. Adjust error message used when key is wrong. Fix Coverity issues. (Christian Brabandt, closes #8420, closes #8411)
author Bram Moolenaar <Bram@vim.org>
date Mon, 21 Jun 2021 21:15:04 +0200
parents 7e9e53a0368f
children 7ef7a211f6bf
comparison
equal deleted inserted replaced
24989:55f296521ca3 24990:85d1e82ed134
495 495
496 if (mfp == NULL || mfp->mf_fd < 0) 496 if (mfp == NULL || mfp->mf_fd < 0)
497 return; // no memfile yet, nothing to do 497 return; // no memfile yet, nothing to do
498 old_method = crypt_method_nr_from_name(old_cm); 498 old_method = crypt_method_nr_from_name(old_cm);
499 499
500 if (old_method == CRYPT_M_SOD || crypt_get_method_nr(buf) == CRYPT_M_SOD) 500 // Swapfile encryption not supported by XChaCha20
501 if (crypt_get_method_nr(buf) == CRYPT_M_SOD && *buf->b_p_key != NUL)
501 { 502 {
502 // close the swapfile 503 // close the swapfile
503 mf_close_file(buf, TRUE); 504 mf_close_file(buf, TRUE);
504 buf->b_p_swf = FALSE; 505 buf->b_p_swf = FALSE;
505 return; 506 return;