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:
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user