1
0
forked from aniani/vim

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

@@ -1235,8 +1235,7 @@ do_execreg(
EMSG(_(e_nolastcmd));
return FAIL;
}
vim_free(new_last_cmdline); /* don't keep the cmdline containing @: */
new_last_cmdline = NULL;
VIM_CLEAR(new_last_cmdline); /* don't keep the cmdline containing @: */
/* Escape all control characters with a CTRL-V */
p = vim_strsave_escaped_ext(last_cmdline,
(char_u *)"\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", Ctrl_V, FALSE);
@@ -2995,8 +2994,7 @@ free_yank(long n)
#endif
vim_free(y_current->y_array[i]);
}
vim_free(y_current->y_array);
y_current->y_array = NULL;
VIM_CLEAR(y_current->y_array);
#ifdef AMIGA
if (n >= 1000)
MSG("");
@@ -6040,8 +6038,7 @@ finish_viminfo_registers(void)
vim_free(y_read_regs[i].y_array[j]);
vim_free(y_read_regs[i].y_array);
}
vim_free(y_read_regs);
y_read_regs = NULL;
VIM_CLEAR(y_read_regs);
}
}
@@ -7146,8 +7143,7 @@ str_to_reg(
/* Without any lines make the register empty. */
if (y_ptr->y_size + newlines == 0)
{
vim_free(y_ptr->y_array);
y_ptr->y_array = NULL;
VIM_CLEAR(y_ptr->y_array);
return;
}