0
0
mirror of https://github.com/vim/vim.git synced 2025-10-13 06:54:15 -04:00

patch 8.1.1611: bufadd() reuses existing buffer without a name

Problem:    Bufadd() reuses existing buffer without a name.
Solution:   When the name is empty always create a new buffer.
This commit is contained in:
Bram Moolenaar
2019-06-30 20:33:01 +02:00
parent 15e248e37f
commit 892ae723ab
3 changed files with 19 additions and 1 deletions

View File

@@ -1929,7 +1929,9 @@ find_buffer(typval_T *avar)
static void
f_bufadd(typval_T *argvars, typval_T *rettv)
{
rettv->vval.v_number = buflist_add(tv_get_string(&argvars[0]), 0);
char_u *name = tv_get_string(&argvars[0]);
rettv->vval.v_number = buflist_add(*name == NUL ? NULL : name, 0);
}
/*