Bug in CCFileUtils when checking for relative path


#1

Hi there,

just stumbled over a small bug on CCFileUtils.

In CCFileUtils::fullPathFromRelativePath(const char *pszRelativePath) you don’t check wheter the path is a network-path.
Due to this the path “server\path\file” is expanded to “server\path”. So you should also check if the path is starting with a “”.

I fixed it in line 68 from:

 if ((strlen(pszRelativePath) > 1 && pszRelativePath[1] == ':' )) 

to

 if ((strlen(pszRelativePath) > 1 && (pszRelativePath[1] == ':' || pszRelativePath[0] == '\\'))) 

I noticed this, because I’m mainly developing on mac but also have to test a Windows version.
For this I’m using a vm which connects per network-share to the source-files on the mac.
I’m aware that this set-up is not used very much, however just want to give you a notice.

Best Regards
Cem


#2

Oh, sorry, you must using a early version of cocos2d-x. Can you tell me the version?
I cannot find this line of code in the edge version on github…


#3

We’re using the 0.8.3 release.

I’m just seeing that 0.8.4 also has been released. Seems I’ve overlooked it.
Just saw that this is fixed on 0.8.4. So please just ignore this thread.

Thanks
Cem