summaryrefslogtreecommitdiffstats
path: root/src/definition.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/definition.cpp')
-rw-r--r--src/definition.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/definition.cpp b/src/definition.cpp
index fb20434..e778edd 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -600,7 +600,11 @@ static bool readCodeFragment(const char *fileName,
}
// copy until end of line
result+=c;
- if (c==':') result+=cn;
+ if (c==':')
+ {
+ result+=cn;
+ if (cn=='\n') lineNr++;
+ }
startLine=lineNr;
const int maxLineLength=4096;
char lineStr[maxLineLength];
@@ -617,9 +621,10 @@ static bool readCodeFragment(const char *fileName,
{
size_read=qstrlen(p);
}
- else
+ else // nothing read
{
size_read=-1;
+ lineStr[0]='\0';
}
result+=lineStr;
} while (size_read == (maxLineLength-1));