locale = info->locale;
retvm_if(locale == NULL, PMINFO_R_ERROR, "manifest locale is NULL");
- if (info->pkg_info == NULL)
+ if (info->pkg_info == NULL || info->pkg_info->icon == NULL)
return PMINFO_R_ERROR;
for (tmp = info->pkg_info->icon; tmp; tmp = tmp->next) {
ptr = (icon_x *)tmp->data;
- if (ptr && ptr->text == NULL)
- ptr->text = strdup("");
if (ptr == NULL || ptr->text == NULL || ptr->lang == NULL ||
- !strcasecmp(ptr->text, "(null)") ||
strcmp(ptr->lang, locale))
continue;
*icon = (char *)ptr->text;
locale = DEFAULT_LOCALE;
for (tmp = info->pkg_info->icon; tmp; tmp = tmp->next) {
ptr = (icon_x *)tmp->data;
- if (ptr && ptr->text == NULL)
- ptr->text = strdup("");
if (ptr == NULL || ptr->text == NULL || ptr->lang == NULL ||
strcmp(ptr->lang, locale))
continue;
return PMINFO_R_OK;
}
- return PMINFO_R_ERROR;
+ *icon = "";
+
+ return PMINFO_R_OK;
}
API int pkgmgrinfo_pkginfo_get_label(pkgmgrinfo_pkginfo_h handle, char **label)
locale = info->locale;
retvm_if(locale == NULL, PMINFO_R_ERROR, "manifest locale is NULL");
+ if (info->pkg_info == NULL || info->pkg_info->label == NULL)
+ return PMINFO_R_ERROR;
+
for (tmp = info->pkg_info->label; tmp != NULL; tmp = tmp->next) {
ptr = (label_x *)tmp->data;
- if (ptr && ptr->text == NULL)
- ptr->text = strdup("");
if (ptr == NULL || ptr->text == NULL || ptr->lang == NULL ||
strcmp(ptr->lang, locale))
continue;
locale = DEFAULT_LOCALE;
for (tmp = info->pkg_info->label; tmp != NULL; tmp = tmp->next) {
ptr = (label_x *)tmp->data;
- if (ptr && ptr->text == NULL)
- ptr->text = strdup("");
if (ptr == NULL || ptr->text == NULL || ptr->lang == NULL ||
strcmp(ptr->lang, locale))
continue;
return PMINFO_R_OK;
}
- return PMINFO_R_ERROR;
+ *label = "";
+
+ return PMINFO_R_OK;
}
API int pkgmgrinfo_pkginfo_get_description(pkgmgrinfo_pkginfo_h handle, char **description)
locale = info->locale;
retvm_if(locale == NULL, PMINFO_R_ERROR, "manifest locale is NULL");
+ if (info->pkg_info == NULL || info->pkg_info->description == NULL)
+ return PMINFO_R_ERROR;
+
for (tmp = info->pkg_info->description; tmp; tmp = tmp->next) {
ptr = (description_x *)tmp->data;
- if (ptr && ptr->text == NULL)
- ptr->text = strdup("");
if (ptr == NULL || ptr->text == NULL || ptr->lang == NULL ||
strcmp(ptr->lang, locale))
continue;
locale = DEFAULT_LOCALE;
for (tmp = info->pkg_info->description; tmp; tmp = tmp->next) {
ptr = (description_x *)tmp->data;
- if (ptr && ptr->text == NULL)
- ptr->text = strdup("");
if (ptr == NULL || ptr->text == NULL || ptr->lang == NULL ||
strcmp(ptr->lang, locale))
continue;
return PMINFO_R_OK;
}
- return PMINFO_R_ERROR;
+ *description = "";
+
+ return PMINFO_R_OK;
}
API int pkgmgrinfo_pkginfo_get_author_name(pkgmgrinfo_pkginfo_h handle, char **author_name)