0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -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:
Bram Moolenaar
2018-02-10 18:45:26 +01:00
parent 42443c7d7f
commit d23a823669
54 changed files with 233 additions and 465 deletions

View File

@@ -4326,10 +4326,7 @@ win_line(
#endif
if (p_extra_free != NULL)
{
vim_free(p_extra_free);
p_extra_free = NULL;
}
VIM_CLEAR(p_extra_free);
/*
* Get a character from the line itself.
*/
@@ -8860,27 +8857,17 @@ give_up:
* and over again. */
done_outofmem_msg = TRUE;
}
vim_free(new_ScreenLines);
new_ScreenLines = NULL;
VIM_CLEAR(new_ScreenLines);
#ifdef FEAT_MBYTE
vim_free(new_ScreenLinesUC);
new_ScreenLinesUC = NULL;
VIM_CLEAR(new_ScreenLinesUC);
for (i = 0; i < p_mco; ++i)
{
vim_free(new_ScreenLinesC[i]);
new_ScreenLinesC[i] = NULL;
}
vim_free(new_ScreenLines2);
new_ScreenLines2 = NULL;
VIM_CLEAR(new_ScreenLinesC[i]);
VIM_CLEAR(new_ScreenLines2);
#endif
vim_free(new_ScreenAttrs);
new_ScreenAttrs = NULL;
vim_free(new_LineOffset);
new_LineOffset = NULL;
vim_free(new_LineWraps);
new_LineWraps = NULL;
vim_free(new_TabPageIdxs);
new_TabPageIdxs = NULL;
VIM_CLEAR(new_ScreenAttrs);
VIM_CLEAR(new_LineOffset);
VIM_CLEAR(new_LineWraps);
VIM_CLEAR(new_TabPageIdxs);
}
else
{