Mercurial > vim
diff src/fileio.c @ 15531:959cf4c63b18 v8.1.0773
patch 8.1.0773: not all crypt code is tested
commit https://github.com/vim/vim/commit/987411db9e4b76b524d0579db21074be0bffd61b
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jan 18 22:48:34 2019 +0100
patch 8.1.0773: not all crypt code is tested
Problem: Not all crypt code is tested.
Solution: Disable unused crypt code. Add more test coverage.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 18 Jan 2019 23:00:08 +0100 |
parents | 2ad5f0ffaa2e |
children | dd725a8ab112 |
line wrap: on
line diff
--- a/src/fileio.c +++ b/src/fileio.c @@ -1381,9 +1381,12 @@ retry: if (cryptkey != NULL && curbuf->b_cryptstate != NULL && size > 0) { +# ifdef CRYPT_NOT_INPLACE if (crypt_works_inplace(curbuf->b_cryptstate)) { +# endif crypt_decode_inplace(curbuf->b_cryptstate, ptr, size); +# ifdef CRYPT_NOT_INPLACE } else { @@ -1434,6 +1437,7 @@ retry: } size = decrypted_size; } +# endif } #endif @@ -5768,9 +5772,12 @@ buf_write_bytes(struct bw_info *ip) { /* Encrypt the data. Do it in-place if possible, otherwise use an * allocated buffer. */ +# ifdef CRYPT_NOT_INPLACE if (crypt_works_inplace(ip->bw_buffer->b_cryptstate)) { +# endif crypt_encode_inplace(ip->bw_buffer->b_cryptstate, buf, len); +# ifdef CRYPT_NOT_INPLACE } else { @@ -5783,6 +5790,7 @@ buf_write_bytes(struct bw_info *ip) vim_free(outbuf); return (wlen < len) ? FAIL : OK; } +# endif } #endif