From: Tae-Jeong Lee Date: Tue, 16 Jul 2013 08:55:36 +0000 (+0900) Subject: Add exception handling to w3c_file_localization for double root, "//". X-Git-Tag: submit/tizen_2.2/20130927.091100^2~48 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=58ab81974f1f9aa97af6d6da56492f0b8666c26d;p=platform%2Fframework%2Fweb%2Fwrt-commons.git Add exception handling to w3c_file_localization for double root, "//". [Issue#] N/A [Problem] Exception handling [Cause] N/A [Solution] Add exception handling to w3c_file_localization for double root, "//". Change-Id: I375bfda94637465c987fdc21720a08a2ee4ec1df --- diff --git a/modules/localization/src/w3c_file_localization.cpp b/modules/localization/src/w3c_file_localization.cpp old mode 100755 new mode 100644 index 66865ba..46c4194 --- a/modules/localization/src/w3c_file_localization.cpp +++ b/modules/localization/src/w3c_file_localization.cpp @@ -149,6 +149,7 @@ std::string getFilePathInWidgetPackageFromUrl(const std::string &tzAppId, const const std::string SCHEME_WIDGET = "widget://"; const std::string SCHEM_APP = "app://"; const std::string LOCALE_PATH = "locales/"; + const std::string DOUBLE_ROOT = "//"; static std::string lastTzAppId; static WidgetDAOReadOnlyPtr dao; @@ -186,6 +187,13 @@ std::string getFilePathInWidgetPackageFromUrl(const std::string &tzAppId, const // remove "file://" workingUrl.erase(0, SCHEME_FILE.length()); + // exception handling for "//" + if (workingUrl.compare(0, DOUBLE_ROOT.length(), DOUBLE_ROOT) == 0) + { + workingUrl.erase(0, 1); + LogDebug("workingUrl: " << workingUrl); + } + // remove src path if (workingUrl.compare(0, srcPath.length(), srcPath) == 0) {