From a346d71a91c042c278fa955b971e4d4600a7ac97 Mon Sep 17 00:00:00 2001 From: chuanweizhang2013 Date: Tue, 18 Mar 2014 15:56:01 +0800 Subject: [PATCH] fixed reserlution order --- cocos/2d/platform/apple/CCFileUtilsApple.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cocos/2d/platform/apple/CCFileUtilsApple.mm b/cocos/2d/platform/apple/CCFileUtilsApple.mm index 9c9443e0f7..c2d32600de 100644 --- a/cocos/2d/platform/apple/CCFileUtilsApple.mm +++ b/cocos/2d/platform/apple/CCFileUtilsApple.mm @@ -302,7 +302,11 @@ std::string FileUtilsApple::getFullPathForDirectoryAndFilename(const std::string } else { - std::string fullPath = directory+filename; + std::string fullPath = directory; + if (!directory.empty() && directory[directory.length()-1] != '/') + fullPath.append("/"); + + fullPath.append(filename); // Search path is an absolute path. if ([s_fileManager fileExistsAtPath:[NSString stringWithUTF8String:fullPath.c_str()]]) { return fullPath;