Skip to content

Commit

Permalink
Make tag reader able to read tag files created with the option --excm…
Browse files Browse the repository at this point in the history
…d=combine.

Previously the reader would discard everything beyond the first semicolon in the search expression. This was unfortunate because when using the 'combine' option the full search expression has the form <line number>;<search expression>.
  • Loading branch information
OpenSource Compile and Link committed Jun 28, 2019
1 parent 2b0aa59 commit 070b018
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions read/readtags.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ static void parseTagLine (tagFile *file, tagEntry *const entry)
if (tab != NULL)
{
int fieldsPresent;
int combinedPattern;
*tab = '\0';
p = tab + 1;
if (*p == '/' || *p == '?')
Expand Down Expand Up @@ -471,6 +472,30 @@ static void parseTagLine (tagFile *file, tagEntry *const entry)
entry->address.lineNumber = atol (p);
while (isdigit ((int) *(unsigned char*) p))
++p;
if (p)
{
combinedPattern = (strncmp (p, ";/", 2) == 0) ||
(strncmp (p, ";?", 2) == 0);
if (combinedPattern)
{
++p;
/* parse pattern */
int delimiter = *(unsigned char*) p;
do
{
p = strchr (p + 1, delimiter);
} while (p != NULL
&& isOdd (countContinuousBackslashesBackward (p - 1,
entry->address.pattern)));

if (p == NULL)
{
/* invalid pattern */
}
else
++p;
}
}
}
else
{
Expand Down

0 comments on commit 070b018

Please sign in to comment.