[Liblas-commits] hg: reset eof bit when reading VLRs in the case of having no poi...

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Aug 17 15:56:54 EDT 2010


changeset 35036dd06ad7 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=35036dd06ad7
summary: reset eof bit when reading VLRs in the case of having no points in the file

diffstat:

 src/detail/reader/header.cpp |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (17 lines):

diff -r 0dfc6034dda0 -r 35036dd06ad7 src/detail/reader/header.cpp
--- a/src/detail/reader/header.cpp	Tue Aug 17 14:27:38 2010 -0500
+++ b/src/detail/reader/header.cpp	Tue Aug 17 14:56:48 2010 -0500
@@ -363,6 +363,13 @@
 {
     VLRHeader vlrh = { 0 };
 
+    if (m_ifs.eof()) {
+        // if we hit the end of the file already, it's because 
+        // we don't have any points.  We still want to read the VLRs 
+        // in that case.
+        m_ifs.clear();  
+    }
+
     // seek to the start of the VLRs
     m_ifs.seekg(m_header->GetHeaderSize(), std::ios::beg);
 


More information about the Liblas-commits mailing list