From f0baeacb7de890ac56dd98fbd89f4a7153513dbb Mon Sep 17 00:00:00 2001 From: "minje.ahn" Date: Wed, 6 Mar 2024 15:17:19 +0900 Subject: [PATCH] Use ms_user_get_root_length Change-Id: I6c08d3849b54e911b62992b12280f44101bcabd2 Signed-off-by: minje.ahn --- src/common/media-svc-media-folder.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/common/media-svc-media-folder.c b/src/common/media-svc-media-folder.c index f1f3825..8f0903b 100755 --- a/src/common/media-svc-media-folder.c +++ b/src/common/media-svc-media-folder.c @@ -86,20 +86,9 @@ int _media_svc_update_folder_modified_time(const char *folder_path, uid_t uid) static int __media_svc_append_parent_folder(sqlite3 *handle, bool is_direct, const char *storage_id, const char *path, uid_t uid) { int ret = MS_MEDIA_ERR_NONE; - unsigned int next_pos = 0; + size_t next_pos = ms_user_get_root_length(path, uid); char *next = NULL; char *dir_path = NULL; - char *internal_path = NULL; - - if (g_str_has_prefix(path, tzplatform_getenv(TZ_SYS_STORAGE))) { - next_pos = strlen(tzplatform_getenv(TZ_SYS_STORAGE)) + 1; - } else { - ret = ms_user_get_internal_root_path(uid, &internal_path); - media_svc_retvm_if(ret != MS_MEDIA_ERR_NONE, ret, "Fail to get root path"); - - next_pos = strlen(internal_path); - g_free(internal_path); - } do { next = strstr(path + next_pos, "/"); -- 2.7.4