Support empty appcontrol strings 23/41423/1 submit/tizen/20150615.110504
authorSemun Lee <sm79.lee@samsung.com>
Mon, 15 Jun 2015 08:28:20 +0000 (17:28 +0900)
committerSemun Lee <sm79.lee@samsung.com>
Mon, 15 Jun 2015 08:28:20 +0000 (17:28 +0900)
Change-Id: I178a907be4eb6da08511828d65bc7587385f0bea
Signed-off-by: Semun Lee <sm79.lee@samsung.com>
parser/pkgmgr_parser_db.c

index 8f6c89f..d1f2d7c 100644 (file)
@@ -979,9 +979,9 @@ static int __insert_uiapplication_appcontrol_info(manifest_x *mfx)
                acontrol = up->appcontrol;
                while (acontrol != NULL) {
                        snprintf(buf, BUFSIZE, "%s|%s|%s",\
-                                       acontrol->operation ? acontrol->operation : "NULL",
-                                       acontrol->uri ? acontrol->uri : "NULL",
-                                       acontrol->mime ? acontrol->mime : "NULL");
+                                       acontrol->operation ? (strlen(acontrol->operation) > 0 ? acontrol->operation : "NULL") : "NULL",
+                                       acontrol->uri ? (strlen(acontrol->uri) > 0 ? acontrol->uri : "NULL") : "NULL",
+                                       acontrol->mime ? (strlen(acontrol->mime) > 0 ? acontrol->mime : "NULL") : "NULL");
                        snprintf(query, MAX_QUERY_LEN,
                                        "insert into package_app_app_control(app_id, app_control) " \
                                        "values('%s', '%s')",\
@@ -1305,9 +1305,9 @@ static int __insert_serviceapplication_appcontrol_info(manifest_x *mfx)
                acontrol = sp->appcontrol;
                while (acontrol != NULL) {
                        snprintf(buf, BUFSIZE, "%s|%s|%s",
-                                       acontrol->operation ? acontrol->operation : "NULL",
-                                       acontrol->uri ? acontrol->uri : "NULL",
-                                       acontrol->mime ? acontrol->mime : "NULL");
+                                       acontrol->operation ? (strlen(acontrol->operation) > 0 ? acontrol->operation : "NULL") : "NULL",
+                                       acontrol->uri ? (strlen(acontrol->uri) > 0 ? acontrol->uri : "NULL") : "NULL",
+                                       acontrol->mime ? (strlen(acontrol->mime) > 0 ? acontrol->mime : "NULL") : "NULL");
                        snprintf(query, MAX_QUERY_LEN,
                                        "insert into package_app_app_control(app_id, app_control) " \
                                        "values('%s', '%s')",\