summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-07-28 19:20:27 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-28 09:32:53 -0700
commit921041163be940d22ecffa5dc544add97c0bc0e1 (patch)
tree4fe22e9aaeee9e9a698a1dcffabd7999b31a0372 /tests
parent96b612941efdd8b65cc954217d80fb6d3724cabb (diff)
downloadsubsurface-921041163be940d22ecffa5dc544add97c0bc0e1.tar.gz
Seabear import: fix detection of empty lines
The old code trusted in Windows new lines with length of 3. The new code strips out spaces and line ending chars resulting in empty line being of length 0. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/testparse.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/testparse.cpp b/tests/testparse.cpp
index 9288baf63..fa1d6d223 100644
--- a/tests/testparse.cpp
+++ b/tests/testparse.cpp
@@ -166,7 +166,7 @@ void TestParse::testParseNewFormat()
*/
f.open(QFile::ReadOnly);
- while ((firstLine = f.readLine()).length() > 3 && !f.atEnd()) {
+ while ((firstLine = f.readLine().trimmed()).length() > 0 && !f.atEnd()) {
if (firstLine.contains("//Log interval: "))
delta = firstLine.remove(QString::fromLatin1("//Log interval: ")).trimmed().remove(QString::fromLatin1(" s"));
}