summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-12-09 19:58:40 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-12-09 19:58:40 (GMT)
commit237014486642e511103f3f5111bd3164d2bd6c26 (patch)
tree604271a17f920fd55a0ca3f6b779cdf78e13a53b /src
parent772046d4e43fea32cf6dedf13f4b0497a4125528 (diff)
parent79b40a437092bccb6589cdb29c0059a4797b771d (diff)
downloadDoxygen-237014486642e511103f3f5111bd3164d2bd6c26.zip
Doxygen-237014486642e511103f3f5111bd3164d2bd6c26.tar.gz
Doxygen-237014486642e511103f3f5111bd3164d2bd6c26.tar.bz2
Merge pull request #256 from albert-github/feature/bug_first_line_inline
Extra empty line in source fragments
Diffstat (limited to 'src')
-rw-r--r--src/definition.cpp5
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==':')
{