Add exception handling to w3c_file_localization for double root, "//".
authorTae-Jeong Lee <taejeong.lee@samsung.com>
Tue, 16 Jul 2013 08:55:36 +0000 (17:55 +0900)
committerTae-Jeong Lee <taejeong.lee@samsung.com>
Wed, 17 Jul 2013 07:13:31 +0000 (16:13 +0900)
[Issue#] N/A
[Problem] Exception handling
[Cause] N/A
[Solution] Add exception handling to w3c_file_localization for double root, "//".

Change-Id: I375bfda94637465c987fdc21720a08a2ee4ec1df

modules/localization/src/w3c_file_localization.cpp [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 66865ba..46c4194
@@ -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)
         {