mirror of
https://github.com/vim/vim.git
synced 2025-10-06 05:44:14 -04:00
patch 8.0.1496: clearing a pointer takes two lines
Problem: Clearing a pointer takes two lines. Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi, closes #2629)
This commit is contained in:
@@ -535,8 +535,7 @@ ml_set_crypt_key(
|
||||
idx = 0; /* start with first index in block 1 */
|
||||
error = 0;
|
||||
buf->b_ml.ml_stack_top = 0;
|
||||
vim_free(buf->b_ml.ml_stack);
|
||||
buf->b_ml.ml_stack = NULL;
|
||||
VIM_CLEAR(buf->b_ml.ml_stack);
|
||||
buf->b_ml.ml_stack_size = 0; /* no stack yet */
|
||||
|
||||
for ( ; !got_int; line_breakcheck())
|
||||
@@ -852,8 +851,7 @@ ml_close(buf_T *buf, int del_file)
|
||||
vim_free(buf->b_ml.ml_line_ptr);
|
||||
vim_free(buf->b_ml.ml_stack);
|
||||
#ifdef FEAT_BYTEOFF
|
||||
vim_free(buf->b_ml.ml_chunksize);
|
||||
buf->b_ml.ml_chunksize = NULL;
|
||||
VIM_CLEAR(buf->b_ml.ml_chunksize);
|
||||
#endif
|
||||
buf->b_ml.ml_mfp = NULL;
|
||||
|
||||
@@ -4197,8 +4195,7 @@ findswapname(
|
||||
break;
|
||||
if ((n = (int)STRLEN(fname)) == 0) /* safety check */
|
||||
{
|
||||
vim_free(fname);
|
||||
fname = NULL;
|
||||
VIM_CLEAR(fname);
|
||||
break;
|
||||
}
|
||||
#if defined(UNIX)
|
||||
@@ -4578,8 +4575,7 @@ findswapname(
|
||||
if (fname[n - 2] == 'a') /* ".saa": tried enough, give up */
|
||||
{
|
||||
EMSG(_("E326: Too many swap files found"));
|
||||
vim_free(fname);
|
||||
fname = NULL;
|
||||
VIM_CLEAR(fname);
|
||||
break;
|
||||
}
|
||||
--fname[n - 2]; /* ".svz", ".suz", etc. */
|
||||
|
Reference in New Issue
Block a user