From a84873a67b71a7551f061aa92e62a572e0efdad9 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 19 Mar 2014 17:56:29 +0800 Subject: [PATCH] closed #4450: FileUtils::addSearchResolutionsOrder doesn't check whether there is a 'slash' at the end of path. --- cocos/2d/platform/CCFileUtils.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cocos/2d/platform/CCFileUtils.cpp b/cocos/2d/platform/CCFileUtils.cpp index 845739ccd3..f525ee99f6 100644 --- a/cocos/2d/platform/CCFileUtils.cpp +++ b/cocos/2d/platform/CCFileUtils.cpp @@ -742,7 +742,11 @@ void FileUtils::setSearchResolutionsOrder(const std::vector& search void FileUtils::addSearchResolutionsOrder(const std::string &order) { - _searchResolutionsOrderArray.push_back(order); + std::string resOrder = order; + if (!resOrder.empty() && resOrder[resOrder.length()-1] != '/') + resOrder.append("/"); + + _searchResolutionsOrderArray.push_back(resOrder); } const std::vector& FileUtils::getSearchResolutionsOrder()