diff options
author | albert-github <albert.tests@gmail.com> | 2014-12-07 18:35:17 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2014-12-07 18:35:17 (GMT) |
commit | 79b40a437092bccb6589cdb29c0059a4797b771d (patch) | |
tree | bf738f18dddbbbba850ae128afc7ba96d35205df /src/definition.cpp | |
parent | 540f0b66972c03fd53c97174e1680230b8dd4026 (diff) | |
download | Doxygen-79b40a437092bccb6589cdb29c0059a4797b771d.zip Doxygen-79b40a437092bccb6589cdb29c0059a4797b771d.tar.gz Doxygen-79b40a437092bccb6589cdb29c0059a4797b771d.tar.bz2 |
Extra empty line in source fragments
In case of a language that does not uses curly brackets to define blocks (such as Fortran) there was a newline character in the variable c and this was written in the "code fragment" buffer and subsequently written to the output resulting in and extra empty line on top. I languages using curly brackets this is later overwritten by the while loop searching for the open curly bracket.
Diffstat (limited to 'src/definition.cpp')
-rw-r--r-- | src/definition.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/definition.cpp b/src/definition.cpp index 4e90818..2f66c4f 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -755,6 +755,7 @@ bool readCodeFragment(const char *fileName, { while ((c=fgetc(f))!='\n' && c!=EOF) /* skip */; lineNr++; + if (found && c == '\n') c = '\0'; } if (!feof(f)) { @@ -763,7 +764,7 @@ bool readCodeFragment(const char *fileName, while (lineNr<=endLine && !feof(f) && !found) { int pc=0; - while ((c=fgetc(f))!='{' && c!=':' && c!=EOF) + while ((c=fgetc(f))!='{' && c!=':' && c!=EOF) // } so vi matching brackets has no problem { //printf("parsing char `%c'\n",c); if (c=='\n') @@ -816,7 +817,7 @@ bool readCodeFragment(const char *fileName, result+=spaces; } // copy until end of line - result+=c; + if (c) result+=c; startLine=lineNr; if (c==':') { |