Fixed bug ID0002513, where Mesh.export failed.

The failure occered when Mesh.export was passed just a filename, such as 'out.stl'. If
'/some/path/out.stl' was passed it succeeded.
This commit is contained in:
Wolfgang E. Sanyer
2016-05-08 19:07:23 -04:00
committed by wmayer
parent dc12e8b72b
commit 5540dd81c2
2 changed files with 29 additions and 17 deletions

View File

@@ -92,6 +92,9 @@ std::wstring ConvertToWideString(const std::string& string)
wideCharString = NULL;
return wideString;
}
#define GetCurrentDir direct::_getcwd
#elif defined (FC_OS_LINUX) || defined(FC_OS_CYGWIN) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
#define GetCurrentDir unistd::getcwd
#endif
@@ -225,7 +228,16 @@ std::string FileInfo::fileName () const
std::string FileInfo::dirPath () const
{
return FileName.substr(0,FileName.find_last_of('/'));
std::size_t last_pos;
std::string retval;
last_pos = FileName.find_last_of('/');
if (last_pos != std::string::npos) {
retval = FileName.substr(0, last_pos);
}
else{
retval = std::string(GetCurrentDir(NULL, 0));
}
return retval;
}
std::string FileInfo::fileNamePure () const