[cig-commits] [commit] master: Correctly handle end of ASCII file reads (4075a02)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Oct 8 17:06:32 PDT 2014


Repository : https://github.com/geodynamics/vc

On branch  : master
Link       : https://github.com/geodynamics/vc/compare/23464fca3efa2b6ad7ee0ce8f60c225b18b49741...e4325192ad1118379f46ba66899cb98143d09e04

>---------------------------------------------------------------

commit 4075a0214a2274dc7bb37bd3afaa8a902958ab9d
Author: Eric Heien <emheien at ucdavis.edu>
Date:   Tue Oct 7 23:01:10 2014 -0700

    Correctly handle end of ASCII file reads


>---------------------------------------------------------------

4075a0214a2274dc7bb37bd3afaa8a902958ab9d
 quakelib/src/QuakeLibIO.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/quakelib/src/QuakeLibIO.cpp b/quakelib/src/QuakeLibIO.cpp
index 9f1c325..332ddbf 100644
--- a/quakelib/src/QuakeLibIO.cpp
+++ b/quakelib/src/QuakeLibIO.cpp
@@ -2790,7 +2790,7 @@ int quakelib::ModelEventSet::read_file_ascii(const std::string &event_file_name,
         unsigned int num_rec_sweeps = new_event.getNumRecordedSweeps();
         new_sweeps.read_ascii(sweep_file, num_rec_sweeps);
         new_event.setSweeps(new_sweeps);
-        _events.push_back(new_event);
+        if (!event_file.eof() && !sweep_file.eof()) _events.push_back(new_event);
     }
 
     // Close the files



More information about the CIG-COMMITS mailing list