Parsing files with json file extension to read config of plugins
authorYunchan Cho <yunchan.cho@samsung.com>
Sat, 5 Oct 2013 13:53:42 +0000 (22:53 +0900)
committerSoo-Hyun Choi <sh9.choi@samsung.com>
Mon, 7 Oct 2013 07:59:45 +0000 (07:59 +0000)
[Issue#]   P131004-03430
[Problem]  Occasional libjson-glib crash occurs during parsing files.
[Cause]    libjson-glib does not handle non-json files internally.
[Solution] web-provider requests to parse json files only to libjson-glib

Change-Id: Iebe4b00f004bfdb06b9baf67045f3746881cf9f4

src/API/web_provider_plugin_info.cpp

index 98f2f03..1c3ee0f 100755 (executable)
@@ -92,8 +92,10 @@ web_provider_plugin_info** web_provider_plugin_get_installed_list(int* count)
             continue;
         }
 
-        LogD("config file: %s", configPath.c_str());
-        configList.push_back(configPath);
+        if (configPath.substr(configPath.find_last_of(".")) == jsonFileExtension) {
+            LogD("config file: %s", configPath.c_str());
+            configList.push_back(configPath);
+        }
     }
     // close directory of web provider plugin
     closedir(dir);