From 070b018e2b973e64aa7f53ed0e0b53bca2a3f942 Mon Sep 17 00:00:00 2001 From: OpenSource Compile and Link Date: Fri, 28 Jun 2019 15:04:50 +0200 Subject: [PATCH] Make tag reader able to read tag files created with the option --excmd=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 ;. --- read/readtags.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/read/readtags.c b/read/readtags.c index 4814ab6b02..abe29ebf37 100644 --- a/read/readtags.c +++ b/read/readtags.c @@ -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 == '?') @@ -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 {