From: Youngjae Cho Date: Mon, 29 Jul 2024 04:12:19 +0000 (+0900) Subject: init_db: Add fallback for matching previous style feature X-Git-Tag: accepted/tizen/unified/20240801.150145^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_unified_dev;p=platform%2Fcore%2Fapi%2Fsystem-info.git init_db: Add fallback for matching previous style feature The commit 114901968a5bb35d104feca8dc4baf5b167828e3 has changed feature matching style. However, there are features that haven't been changed to the latest style. Therefore it also supports matching the previous style feature. Change-Id: I6464f980ec6c0f2ac1900ac319ece25636b0e06d Signed-off-by: Youngjae Cho --- diff --git a/src/init_db/system_info_db_init.c b/src/init_db/system_info_db_init.c index d03600f..c02958f 100644 --- a/src/init_db/system_info_db_init.c +++ b/src/init_db/system_info_db_init.c @@ -355,7 +355,14 @@ static int system_info_get_values_config_xml(const char *db_path, const char *pa continue; } - value = (char *)xmlGetProp(cur_node, (const xmlChar*)"value"); + /** + * Match the latest style first + * : + * and if it fails to match, do fallback. Match the old style + * : false + */ + value = (char *)xmlGetProp(cur_node, (const xmlChar*)"value") ? : + (char *)xmlNodeListGetString(doc, cur_node->xmlChildrenNode, 1); if (!value) { xmlFree(name); xmlFree(type);