Skip to content

Commit 9cd1b64

Browse files
albert-githubdoxygen
authored andcommitted
issue #9195 fix for warning: documentation for unknown define
Corrected test for adding a `\n` character to help preprocessor / parser
1 parent f4882b1 commit 9cd1b64

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/doxygen.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10031,16 +10031,24 @@ static std::shared_ptr<Entry> parseFile(OutlineParserInterface &parser,
1003110031
BufStr inBuf(fi.size()+4096);
1003210032
msg("Preprocessing %s...\n",qPrint(fn));
1003310033
readInputFile(fileName,inBuf);
10034+
if (inBuf.data() && inBuf.curPos()>1 && *(inBuf.data()+inBuf.curPos()-2)!='\n')
10035+
{
10036+
// add extra newline to preprocessor
10037+
*(inBuf.data()+inBuf.curPos()-1) = '\n';
10038+
inBuf.addChar('\0');
10039+
}
1003410040
preprocessor.processFile(fileName,inBuf,preBuf);
1003510041
}
1003610042
else // no preprocessing
1003710043
{
1003810044
msg("Reading %s...\n",qPrint(fn));
1003910045
readInputFile(fileName,preBuf);
10040-
}
10041-
if (preBuf.data() && preBuf.curPos()>0 && *(preBuf.data()+preBuf.curPos()-1)!='\n')
10042-
{
10043-
preBuf.addChar('\n'); // add extra newline to help parser
10046+
if (preBuf.data() && preBuf.curPos()>1 && *(preBuf.data()+preBuf.curPos()-2)!='\n')
10047+
{
10048+
// add extra newline to help parser
10049+
*(preBuf.data()+preBuf.curPos()-1) = '\n';
10050+
preBuf.addChar('\0');
10051+
}
1004410052
}
1004510053

1004610054
BufStr convBuf(preBuf.curPos()+1024);

0 commit comments

Comments
 (0)