Skip to content

Commit 78b123d

Browse files
committed
issue doxygen#10516 @copybrief command does not take effect with 1.10.0
There were a number of issues still: - in case no `\n` present the second match string was empty and it was not recognized as match anymore - multiple `\n` at the end were not handled.
1 parent fd480c7 commit 78b123d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/commentscan.l

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3898,16 +3898,21 @@ static inline void setOutput(yyscan_t yyscanner,OutputContext ctx)
38983898
}
38993899
else
39003900
{
3901-
static const reg::Ex nonBrief(R"( *[\\@]ifile *\"[^\"]*\" *[\\@]ilinebr *[\\@]iline *(\d+) *[\\@]ilinebr *([\n]?))");
3901+
static const reg::Ex nonBrief(R"( *[\\@]ifile *\"[^\"]*\" *[\\@]ilinebr *[\\@]iline *(\d+) *[\\@]ilinebr( *\n*))");
39023902
std::string str = yyextra->current->brief.str();
39033903
reg::Match match;
39043904
if (reg::match(str,match,nonBrief)) // match found
39053905
{
3906-
if (QCString(match[2].str()) == "\n")
3906+
size_t cnt = 0;
3907+
for (size_t i = 0; i < match[2].str().size(); i++)
39073908
{
3908-
yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-1);
3909+
if (match[2].str()[i] == '\n') cnt++;
3910+
}
3911+
if (cnt)
3912+
{
3913+
yyextra->current->brief = yyextra->current->brief.left(yyextra->current->brief.length()-cnt);
39093914
// set warning line correct
3910-
yyextra->current->brief += "\\iline " + QCString().setNum(1 + static_cast<int>(std::stoul(match[1].str()))) + " \\ilinebr ";
3915+
yyextra->current->brief += "\\iline " + QCString().setNum(cnt + static_cast<int>(std::stoul(match[1].str()))) + " \\ilinebr ";
39113916
}
39123917
foundMatch = true;
39133918
}

0 commit comments

Comments
 (0)