fixed a bug in CCFileUtils.cpp of blackberry port.

This commit is contained in:
James Chen 2012-08-24 14:35:51 +08:00
parent 5e5b71a396
commit e011be88d8
1 changed files with 8 additions and 1 deletions

View File

@ -62,6 +62,7 @@ static std::string fullPathFromRelativePathThreadSafe(const char* pszRelativePat
CCAssert(pszRootPath != NULL, "The resource root path must be set in the main.cpp");
std::string pstrRelativePath = pszRelativePath;
// if the relative path contains root path, skip it.
if (pstrRelativePath.find(pszRootPath) == std::string::npos)
{
ret += pszRootPath;
@ -71,7 +72,13 @@ static std::string fullPathFromRelativePathThreadSafe(const char* pszRelativePat
if (resDir != NULL)
{
ret += resDir;
std::string pstrRootPath = pszRootPath;
std::string pstrResourceFullPath = pstrRootPath + resDir;
// if the relative path contains root path and resource directory, skip it.
if (pstrRelativePath.find(pstrResourceFullPath.c_str()) == std::string::npos)
{
ret += resDir;
}
}
if (pszRelativePath != NULL)