From 662d0ce811a484d640e7af57f76f7e4d6a0a5fb7 Mon Sep 17 00:00:00 2001 From: cignoni Date: Wed, 24 Feb 2016 05:57:27 +0000 Subject: [PATCH] corrected the FileExtension helper func as suggested in BUG#55 --- wrap/io_trimesh/import.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wrap/io_trimesh/import.h b/wrap/io_trimesh/import.h index 872530dc..3d13a119 100644 --- a/wrap/io_trimesh/import.h +++ b/wrap/io_trimesh/import.h @@ -94,15 +94,13 @@ return lastType; public: // simple aux function that returns true if a given file has a given extesnion -static bool FileExtension(std::string filename, std::string extension) +static bool FileExtension(std::string filename, std::string extension) { - std::locale loc1 ; - std::use_facet > ( loc1 ).tolower(&*filename.begin(),&*filename.rbegin()); - std::use_facet > ( loc1 ).tolower(&*extension.begin(),&*extension.rbegin()); + std::transform(filename.begin(), filename.end(), filename.begin(), ::tolower); + std::transform(extension.begin(), extension.end(), extension.begin(), ::tolower); std::string end=filename.substr(filename.length()-extension.length(),extension.length()); return end==extension; } - // Open Mesh, returns 0 on success. static int Open(OpenMeshType &m, const char *filename, CallBackPos *cb=0) {