From f4e532f8d802b958cd0c46c96ab52591e76f3a2c Mon Sep 17 00:00:00 2001 From: zhangkaixiang Date: Thu, 10 Aug 2023 17:31:55 +0800 Subject: [PATCH] fix open docs uri Signed-off-by: zhangkaixiang --- interfaces/kits/js/src/mod_fs/properties/open.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/interfaces/kits/js/src/mod_fs/properties/open.cpp b/interfaces/kits/js/src/mod_fs/properties/open.cpp index c1ec37711..3be355d95 100644 --- a/interfaces/kits/js/src/mod_fs/properties/open.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/open.cpp @@ -163,8 +163,8 @@ napi_value Open::Sync(napi_env env, napi_callback_info info) if (uriType == SCHEME_FILE) { AppFileService::ModuleFileUri::FileUri fileUri(pathStr); pathStr = fileUri.GetRealPath(); - if ((bundleName == MEDIA && pathStr.find(".") == string::npos) || - access(pathStr.c_str(), F_OK) != 0) { + if (bundleName == MEDIA && (pathStr.find(".") == string::npos || + access(pathStr.c_str(), F_OK) != 0)) { int ret = OpenFileByDatashare(uri.ToString(), mode); if (ret >= 0) { auto file = InstantiateFile(env, ret, uri.ToString(), true).val_; @@ -223,8 +223,8 @@ static NError AsyncCbExec(shared_ptr arg, string path, unsigne if (uriType == SCHEME_FILE) { AppFileService::ModuleFileUri::FileUri fileUri(path); pathStr = fileUri.GetRealPath(); - if ((bundleName == MEDIA && pathStr.find(".") == string::npos) || - access(pathStr.c_str(), F_OK) != 0) { + if (bundleName == MEDIA && (pathStr.find(".") == string::npos || + access(pathStr.c_str(), F_OK) != 0)) { int ret = OpenFileByDatashare(path, mode); if (ret >= 0) { arg->fd = ret; -- Gitee