From c4e7e65acb76dae671fd0e51a7742aeaf7ed9161 Mon Sep 17 00:00:00 2001 From: Max Limper Date: Mon, 9 Jul 2018 12:21:46 +0200 Subject: [PATCH] fixed #177 (explicit empty mtl base dir given) --- tiny_obj_loader.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tiny_obj_loader.h b/tiny_obj_loader.h index 9e43a7d..7b9f342 100644 --- a/tiny_obj_loader.h +++ b/tiny_obj_loader.h @@ -1736,9 +1736,8 @@ bool LoadObj(attrib_t *attrib, std::vector *shapes, return false; } - std::string baseDir; - if (mtl_basedir) { - baseDir = mtl_basedir; + std::string baseDir = mtl_basedir ? mtl_basedir : ""; + if (!baseDir.empty()) { #ifndef _WIN32 const char dirsep = '/'; #else