diff options
author | Bram Moolenaar <Bram@vim.org> | 2010-06-12 20:12:02 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2010-06-12 20:12:02 +0200 |
commit | 8bcf9654dcb00a8534a523d6924c16f961338315 (patch) | |
tree | 99abef6db0c38795fc7045e45bc6d0d6812364e0 /src/tag.c | |
parent | 97ea511bbf56d1808260542594cfcdd7e0f963b4 (diff) | |
download | vim-git-8bcf9654dcb00a8534a523d6924c16f961338315.tar.gz |
updated for version 7.2.443
Problem: Using taglist() on a tag file with duplicate fields generates an
internal error. (Peter Odding)
Solution: Check for duplicate field names.
Diffstat (limited to 'src/tag.c')
-rw-r--r-- | src/tag.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -3771,7 +3771,8 @@ expand_tags(tagnames, pat, num_file, file) static int add_tag_field __ARGS((dict_T *dict, char *field_name, char_u *start, char_u *end)); /* - * Add a tag field to the dictionary "dict" + * Add a tag field to the dictionary "dict". + * Return OK or FAIL. */ static int add_tag_field(dict, field_name, start, end) @@ -3783,6 +3784,17 @@ add_tag_field(dict, field_name, start, end) char_u buf[MAXPATHL]; int len = 0; + /* check that the field name doesn't exist yet */ + if (dict_find(dict, (char_u *)field_name, -1) != NULL) + { + if (p_verbose > 0) + { + verbose_enter(); + smsg((char_u *)_("Duplicate field name: %s"), field_name); + verbose_leave(); + } + return FAIL; + } if (start != NULL) { if (end == NULL) |