From: Youngbok Shin Date: Thu, 5 Jan 2017 03:39:57 +0000 (+0900) Subject: fix setting a default font issue in wrong cases X-Git-Tag: accepted/tizen/3.0/common/20170126.092531^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdownload-fonts-service.git;a=commitdiff_plain;h=0488c025920a8e7d774a1c09a7498284ca65834c fix setting a default font issue in wrong cases Even if a deleted font is not related to current font, The download font service changes current font to a default font in some cases. It is caused by using strncmp without "/" character at end of delete dir path. ex. Current Font Path - /opt/share/fonts/org.tizen.downloadablefont1/myfont.ttf Delete Font Path - /opt/share/fonts/org.tizen.downloadablefont The path for comparing should have "/" at end of the path. Change-Id: I76bbd3b06a835edb987093f4ee3226c2eb0c01ac --- diff --git a/pkgmgr_font/src/font_service_register.c b/pkgmgr_font/src/font_service_register.c index 55f072f..726a57c 100755 --- a/pkgmgr_font/src/font_service_register.c +++ b/pkgmgr_font/src/font_service_register.c @@ -633,7 +633,7 @@ int COMMON_PKGMGR_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList * pkgmgrinfo_pkginfo_h handle = NULL; const char* app_root_path = NULL; const char *dest_path = NULL; - int ret; + int ret, deletedir_len; uid_t uid = 0; elm_init(0, NULL); @@ -668,10 +668,12 @@ int COMMON_PKGMGR_PLUGIN_UNINSTALL(const char *pkgid, const char *appid, GList * goto FAIL; } - sprintf(deletedir,"%s/%s", dest_path, appid); + /* It must contain "/" character at end of the delete dir path. + * It prevents file path comparing issues when there are many similar path. */ + sprintf(deletedir,"%s/%s/", dest_path, appid); //check if current using font is same with uninstall font - int deletedir_len = strlen(deletedir); + deletedir_len = strlen(deletedir); pat = FcPatternCreate(); if (pat == NULL)