Skip to content

Commit b38e97b

Browse files
committed
trimming '\r' in material_file name
1 parent b434c24 commit b38e97b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

experimental/tinyobj_loader_opt.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,9 @@ bool parseObj(attrib_t *attrib, std::vector<shape_t> *shapes,
14401440
// std::cout << "mtllib :" << material_filename << std::endl;
14411441

14421442
auto t1 = std::chrono::high_resolution_clock::now();
1443-
1443+
if (material_filename.back() == '\r') {
1444+
material_filename.pop_back();
1445+
}
14441446
std::ifstream ifs(material_filename);
14451447
if (ifs.good()) {
14461448
LoadMtl(&material_map, materials, &ifs);

0 commit comments

Comments
 (0)