diff 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
line wrap: on
line diff
--- a/src/tag.c
+++ b/src/tag.c
@@ -3808,6 +3808,7 @@ test_for_current(
 find_extra(char_u **pp)
 {
     char_u	*str = *pp;
+    char_u	first_char = **pp;
 
     // Repeat for addresses separated with ';'
     for (;;)
@@ -3817,7 +3818,7 @@ find_extra(char_u **pp)
 	else if (*str == '/' || *str == '?')
 	{
 	    str = skip_regexp(str + 1, *str, FALSE, NULL);
-	    if (*str != **pp)
+	    if (*str != first_char)
 		str = NULL;
 	    else
 		++str;
@@ -3837,6 +3838,7 @@ find_extra(char_u **pp)
 		  || !(VIM_ISDIGIT(str[1]) || str[1] == '/' || str[1] == '?'))
 	    break;
 	++str;	// skip ';'
+	first_char = *str;
     }
 
     if (str != NULL && STRNCMP(str, ";\"", 2) == 0)