File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -10031,16 +10031,24 @@ static std::shared_ptr<Entry> parseFile(OutlineParserInterface &parser,
10031
10031
BufStr inBuf (fi.size ()+4096 );
10032
10032
msg (" Preprocessing %s...\n " ,qPrint (fn));
10033
10033
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
+ }
10034
10040
preprocessor.processFile (fileName,inBuf,preBuf);
10035
10041
}
10036
10042
else // no preprocessing
10037
10043
{
10038
10044
msg (" Reading %s...\n " ,qPrint (fn));
10039
10045
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
+ }
10044
10052
}
10045
10053
10046
10054
BufStr convBuf (preBuf.curPos ()+1024 );
You can’t perform that action at this time.
0 commit comments