From fb7c77ede2878c16ef5b22fe0b2a82e8996bb4f3 Mon Sep 17 00:00:00 2001 From: fengjq Date: Wed, 16 Aug 2023 15:21:25 +0800 Subject: [PATCH] Change the method of sorts directories from 'alphasort' to 'versionsort'. Signed-off-by: fengjq --- interfaces/kits/js/src/mod_fs/properties/listfile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interfaces/kits/js/src/mod_fs/properties/listfile.cpp b/interfaces/kits/js/src/mod_fs/properties/listfile.cpp index bab52a41a..e046e1745 100755 --- a/interfaces/kits/js/src/mod_fs/properties/listfile.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/listfile.cpp @@ -266,7 +266,7 @@ static int FilterFileRes(const string &path, vector &dirents) HILOGE("Failed to request heap memory."); return ENOMEM; } - int num = scandir(path.c_str(), &(pNameList->namelist), FilterFunc, alphasort); + int num = scandir(path.c_str(), &(pNameList->namelist), FilterFunc, nullptr); if (num < 0) { HILOGE("Failed to scan dir"); return errno; @@ -285,7 +285,7 @@ static int RecursiveFunc(const string &path, vector &dirents) HILOGE("Failed to request heap memory."); return ENOMEM; } - int num = scandir(path.c_str(), &(pNameList->namelist), FilterFunc, alphasort); + int num = scandir(path.c_str(), &(pNameList->namelist), FilterFunc, nullptr); if (num < 0) { HILOGE("Failed to scan dir"); return errno; -- Gitee