0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -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

@@ -1957,8 +1957,7 @@ write_viminfo(char_u *file, int forceit)
if (!shortname && st_new.st_dev == st_old.st_dev
&& st_new.st_ino == st_old.st_ino)
{
vim_free(tempname);
tempname = NULL;
VIM_CLEAR(tempname);
shortname = TRUE;
break;
}
@@ -5225,8 +5224,7 @@ do_sub(exarg_T *eap)
lnum += regmatch.startpos[0].lnum;
sub_firstlnum += regmatch.startpos[0].lnum;
nmatch -= regmatch.startpos[0].lnum;
vim_free(sub_firstline);
sub_firstline = NULL;
VIM_CLEAR(sub_firstline);
}
if (sub_firstline == NULL)
@@ -5388,10 +5386,7 @@ do_sub(exarg_T *eap)
sub_firstline + copycol);
if (new_line == NULL)
{
vim_free(orig_line);
orig_line = NULL;
}
VIM_CLEAR(orig_line);
else
{
/* Position the cursor relative to the
@@ -5820,8 +5815,7 @@ skip:
if (did_sub)
++sub_nlines;
vim_free(new_start); /* for when substitute was cancelled */
vim_free(sub_firstline); /* free the copy of the original line */
sub_firstline = NULL;
VIM_CLEAR(sub_firstline); /* free the copy of the original line */
}
line_breakcheck();
@@ -6975,8 +6969,7 @@ fix_help_buffer(void)
&& fnamecmp(e1, fname + 4) != 0)
{
/* Not .txt and not .abx, remove it. */
vim_free(fnames[i1]);
fnames[i1] = NULL;
VIM_CLEAR(fnames[i1]);
continue;
}
if (e1 - f1 != e2 - f2
@@ -6984,11 +6977,8 @@ fix_help_buffer(void)
continue;
if (fnamecmp(e1, ".txt") == 0
&& fnamecmp(e2, fname + 4) == 0)
{
/* use .abx instead of .txt */
vim_free(fnames[i1]);
fnames[i1] = NULL;
}
VIM_CLEAR(fnames[i1]);
}
}
#endif