From 4e102d978442f08e6ab86410f9f8d8dee93c9c2f Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 28 Jan 2020 15:30:44 +0100 Subject: [PATCH] Allow to read a binary file with a CRLF EOL at the end of first line --- Mesh_3/include/CGAL/IO/File_binary_mesh_3.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/IO/File_binary_mesh_3.h b/Mesh_3/include/CGAL/IO/File_binary_mesh_3.h index 49764ba15d8..0e056ffc740 100644 --- a/Mesh_3/include/CGAL/IO/File_binary_mesh_3.h +++ b/Mesh_3/include/CGAL/IO/File_binary_mesh_3.h @@ -69,7 +69,10 @@ bool load_binary_file(std::istream& is, C3T3& c3t3) return false; } std::getline(is, s); - if(s != "") { + if(!s.empty()) { + if(s[s.size()-1] == '\r') { // deal with Windows EOL + s.resize(s.size() - 1); + } if(s != std::string(" ") + CGAL::Get_io_signature()()) { std::cerr << "load_binary_file:" << "\n expected format: " << CGAL::Get_io_signature()()