Mercurial > vim
changeset 6807:399216850e36 v7.4.725
patch 7.4.725
Problem: ":call setreg('"', [])" reports an internal error.
Solution: Make the register empty. (Yasuhiro Matsumoto)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Mon, 04 May 2015 20:19:21 +0200 |
parents | 0d413bf8e288 |
children | a784dfdc4467 |
files | src/ops.c src/version.c |
diffstat | 2 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ops.c +++ b/src/ops.c @@ -6642,6 +6642,14 @@ str_to_reg(y_ptr, yank_type, str, len, b } } + /* 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; + return; + } + /* * Allocate an array to hold the pointers to the new register lines. * If the register was not empty, move the existing lines to the new array.