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.
diff --git a/src/fileio.c b/src/fileio.c
index f6a7995..23fe504 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1381,9 +1381,12 @@
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 @@
}
size = decrypted_size;
}
+# endif
}
#endif
@@ -5768,9 +5772,12 @@
{
/* 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 @@
vim_free(outbuf);
return (wlen < len) ? FAIL : OK;
}
+# endif
}
#endif