summaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-18 22:48:34 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-18 22:48:34 +0100
commit987411db9e4b76b524d0579db21074be0bffd61b (patch)
tree215f2c2b7c988b5572e645cbb52c73d65b6bad2a /src/fileio.c
parent0314236aabcb2ca9d0b74074dadecf68d7c7ed5f (diff)
patch 8.1.0773: not all crypt code is testedv8.1.0773
Problem: Not all crypt code is tested. Solution: Disable unused crypt code. Add more test coverage.
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c
index f6a799515e..23fe504527 100644
--- 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