From dcdc5fb42165474067bdbc91fe2cf816d0f22c81 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 4 Sep 2014 18:59:55 +0200 Subject: [PATCH] Fix structural Doxygen comment recognition in the parser. The code wrongly recognized something like "@direction" as a structural "@dir" comment (why is the latter structural is another question). Add a check that we've really found the entire tag and not just a prefix of some other tag. --- Source/CParse/parser.y | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index 678b4b3ac..9347ef1fd 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -115,7 +115,9 @@ int isStructuralDoxygen(String *s){ for (n = 0; n < sizeof(structuralTags)/sizeof(structuralTags[0]); n++) { const size_t len = strlen(structuralTags[n]); if (strncmp(slashPointer, structuralTags[n], len) == 0) { - return 1; + /* Take care to avoid false positives with prefixes of other tags. */ + if (slashPointer[len] == '\0' || isspace(slashPointer[len])) + return 1; } }