aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/tag.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-03-22 20:35:24 -0400
committerGitHub <noreply@github.com>2021-03-22 20:35:24 -0400
commitd41778c993e95c8b37b3d8e10dacc3060ae489da (patch)
tree8849117187c0e8d6f82d21e0bf04a674be84c381 /src/nvim/tag.c
parent1df1098b0c54258a41c4f97c9d3131d061a5b206 (diff)
parente25ebf6b4f1342719b77ced3cc79c113f3dcb41e (diff)
downloadrneovim-d41778c993e95c8b37b3d8e10dacc3060ae489da.tar.gz
rneovim-d41778c993e95c8b37b3d8e10dacc3060ae489da.tar.bz2
rneovim-d41778c993e95c8b37b3d8e10dacc3060ae489da.zip
Merge pull request #14178 from andymass/vim-8.2.0088
[RFC] vim-patch 8.2.0088: insufficient tests for tags...
Diffstat (limited to 'src/nvim/tag.c')
-rw-r--r--src/nvim/tag.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index 8d9ae68985..6b8f393572 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -908,7 +908,7 @@ add_llist_tags(
if (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;
// Save the tag file name
@@ -975,7 +975,8 @@ add_llist_tags(
if (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;
if (cmd[len - 1] == '$') {
@@ -3003,7 +3004,8 @@ static int test_for_current(char_u *fname, char_u *fname_end, char_u *tag_fname,
*/
static int find_extra(char_u **pp)
{
- char_u *str = *pp;
+ char_u *str = *pp;
+ char_u first_char = **pp;
// Repeat for addresses separated with ';'
for (;; ) {
@@ -3011,7 +3013,7 @@ static int find_extra(char_u **pp)
str = skipdigits(str);
} else if (*str == '/' || *str == '?') {
str = skip_regexp(str + 1, *str, false, NULL);
- if (*str != **pp) {
+ if (*str != first_char) {
str = NULL;
} else {
str++;
@@ -3029,6 +3031,7 @@ static int find_extra(char_u **pp)
break;
}
str++; // skip ';'
+ first_char = *str;
}
if (str != NULL && STRNCMP(str, ";\"", 2) == 0) {
@@ -3405,6 +3408,7 @@ int set_tagstack(win_T *wp, const dict_T *d, int action)
if ((di = tv_dict_find(d, "items", -1)) != NULL) {
if (di->di_tv.v_type != VAR_LIST) {
+ EMSG(_(e_listreq));
return FAIL;
}
l = di->di_tv.vval.v_list;