mirror of
https://github.com/neovim/neovim.git
synced 2025-09-25 12:38:33 +00:00
Fix neovim tag bugs uncovered by vim-8.2.0088,
but not related to the patch. Specifically: - settagstack()'s e_listreq is in the wrong place - in :ltag, vim_strncpy -> xstrlcpy length parameter is different xstrlcpy's length includes the null terminator (so add one) - in :ltag, STRNCAT -> xstrlcat takes dest size, not number to copy use snprintf instead
This commit is contained in:
@@ -8809,8 +8809,6 @@ static void f_settagstack(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
|
|
||||||
if (set_tagstack(wp, d, action) == OK) {
|
if (set_tagstack(wp, d, action) == OK) {
|
||||||
rettv->vval.v_number = 0;
|
rettv->vval.v_number = 0;
|
||||||
} else {
|
|
||||||
EMSG(_(e_listreq));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -908,7 +908,7 @@ add_llist_tags(
|
|||||||
if (len > 128) {
|
if (len > 128) {
|
||||||
len = 128;
|
len = 128;
|
||||||
}
|
}
|
||||||
xstrlcpy((char *)tag_name, (const char *)tagp.tagname, len);
|
xstrlcpy((char *)tag_name, (const char *)tagp.tagname, len + 1);
|
||||||
tag_name[len] = NUL;
|
tag_name[len] = NUL;
|
||||||
|
|
||||||
// Save the tag file name
|
// Save the tag file name
|
||||||
@@ -975,7 +975,8 @@ add_llist_tags(
|
|||||||
if (cmd_len > (CMDBUFFSIZE - 5)) {
|
if (cmd_len > (CMDBUFFSIZE - 5)) {
|
||||||
cmd_len = CMDBUFFSIZE - 5;
|
cmd_len = CMDBUFFSIZE - 5;
|
||||||
}
|
}
|
||||||
xstrlcat((char *)cmd, (char *)cmd_start, cmd_len);
|
snprintf((char *)cmd + len, CMDBUFFSIZE + 1 - len,
|
||||||
|
"%.*s", cmd_len, cmd_start);
|
||||||
len += cmd_len;
|
len += cmd_len;
|
||||||
|
|
||||||
if (cmd[len - 1] == '$') {
|
if (cmd[len - 1] == '$') {
|
||||||
@@ -3406,6 +3407,7 @@ int set_tagstack(win_T *wp, const dict_T *d, int action)
|
|||||||
|
|
||||||
if ((di = tv_dict_find(d, "items", -1)) != NULL) {
|
if ((di = tv_dict_find(d, "items", -1)) != NULL) {
|
||||||
if (di->di_tv.v_type != VAR_LIST) {
|
if (di->di_tv.v_type != VAR_LIST) {
|
||||||
|
EMSG(_(e_listreq));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
l = di->di_tv.vval.v_list;
|
l = di->di_tv.vval.v_list;
|
||||||
|
Reference in New Issue
Block a user