From c539c5657c9ad9bae32a1b0e9ab3a65a27f51a79 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 17 Jan 2024 09:56:39 +0100 Subject: [PATCH] fix when reading on Linux a .mesh file produced by Windows --- SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h b/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h index d4dbf04e3f3..f20a4aafcfb 100644 --- a/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h +++ b/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h @@ -599,6 +599,11 @@ bool build_triangulation_from_file(std::istream& is, std::string line; while(std::getline(is, line) && line != "End") { + // remove trailing whitespace, in particular a possible '\r' from Windows + // end-of-line encoding + if(std::isspace(line.back())) { + line.pop_back(); + } if (line.size() > 0 && line.at(0) == '#' && line.find("CGAL::Mesh_complex_3_in_triangulation_3") != std::string::npos) {