comparison src/tag.c @ 19055:8645b73b3645 v8.2.0088

patch 8.2.0088: insufficient tests for tags; bug in using extra tag field Commit: https://github.com/vim/vim/commit/830c1afc9d2cd5819a05c71d4e0b1f748a8c0519 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 5 20:35:44 2020 +0100 patch 8.2.0088: insufficient tests for tags; bug in using extra tag field Problem: Insufficient tests for tags; bug in using extra tag field when using an ex command to position the cursor. Solution: Fix the bug, add more tests. (Yegappan Lakshmanan, closes #5439)
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 Jan 2020 20:45:05 +0100
parents f0312cf3c792
children 2ef19eed524a
comparison
equal deleted inserted replaced
19054:ebee9e4dac40 19055:8645b73b3645
3806 */ 3806 */
3807 static int 3807 static int
3808 find_extra(char_u **pp) 3808 find_extra(char_u **pp)
3809 { 3809 {
3810 char_u *str = *pp; 3810 char_u *str = *pp;
3811 char_u first_char = **pp;
3811 3812
3812 // Repeat for addresses separated with ';' 3813 // Repeat for addresses separated with ';'
3813 for (;;) 3814 for (;;)
3814 { 3815 {
3815 if (VIM_ISDIGIT(*str)) 3816 if (VIM_ISDIGIT(*str))
3816 str = skipdigits(str); 3817 str = skipdigits(str);
3817 else if (*str == '/' || *str == '?') 3818 else if (*str == '/' || *str == '?')
3818 { 3819 {
3819 str = skip_regexp(str + 1, *str, FALSE, NULL); 3820 str = skip_regexp(str + 1, *str, FALSE, NULL);
3820 if (*str != **pp) 3821 if (*str != first_char)
3821 str = NULL; 3822 str = NULL;
3822 else 3823 else
3823 ++str; 3824 ++str;
3824 } 3825 }
3825 else 3826 else
3835 } 3836 }
3836 if (str == NULL || *str != ';' 3837 if (str == NULL || *str != ';'
3837 || !(VIM_ISDIGIT(str[1]) || str[1] == '/' || str[1] == '?')) 3838 || !(VIM_ISDIGIT(str[1]) || str[1] == '/' || str[1] == '?'))
3838 break; 3839 break;
3839 ++str; // skip ';' 3840 ++str; // skip ';'
3841 first_char = *str;
3840 } 3842 }
3841 3843
3842 if (str != NULL && STRNCMP(str, ";\"", 2) == 0) 3844 if (str != NULL && STRNCMP(str, ";\"", 2) == 0)
3843 { 3845 {
3844 *pp = str; 3846 *pp = str;