From 6ee78e7f68e70f121625327aa97f979551e692b3 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Thu, 9 May 2013 14:32:43 +0200 Subject: Handle lack of trailing newline in dat files. Fixes #336 diff --git a/src/surface.cc b/src/surface.cc index 46ddc07..7987b99 100644 --- a/src/surface.cc +++ b/src/surface.cc @@ -122,7 +122,7 @@ PolySet *SurfaceNode::evaluate_polyset(class PolySetEvaluator *) const std::getline(stream, line); boost::trim(line); } - if (stream.eof()) break; + if (line.size() == 0 && stream.eof()) break; int col = 0; tokenizer tokens(line, sep); diff --git a/testdata/scad/features/surface-simple.dat b/testdata/scad/features/surface-simple.dat index 32eba08..166c600 100644 --- a/testdata/scad/features/surface-simple.dat +++ b/testdata/scad/features/surface-simple.dat @@ -1,2 +1,6 @@ 0 1 2 3 + +# Comment + + -- cgit v0.10.1