Merge pull request #3447 from NatWeiss/patch-5

Fixes full paths on Android (cleaner)
This commit is contained in:
minggo 2013-08-25 18:35:57 -07:00
commit c186ed6a7f
1 changed files with 8 additions and 1 deletions

View File

@ -786,7 +786,14 @@ void FileUtils::loadFilenameLookupDictionaryFromFile(const char* filename)
std::string FileUtils::getFullPathForDirectoryAndFilename(const std::string& strDirectory, const std::string& strFilename)
{
std::string ret = strDirectory+strFilename;
// get directory+filename, safely adding '/' as necessary
std::string ret = strDirectory;
if (strDirectory.size() && strDirectory[strDirectory.size()-1] != '/'){
ret += '/';
}
ret += strFilename;
// if the file doesn't exist, return an empty string
if (!isFileExist(ret)) {
ret = "";
}