From ea9e7494dfb0b22f28ac08d6e6c6aa60f5591ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A1=BE=E5=86=AC=E6=B4=8B?= Date: Thu, 31 Jul 2025 03:01:22 +0000 Subject: [PATCH] copy_dir_core.cpp add empty lines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 顾冬洋 --- interfaces/kits/js/src/mod_fs/properties/copy_dir_core.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/interfaces/kits/js/src/mod_fs/properties/copy_dir_core.cpp b/interfaces/kits/js/src/mod_fs/properties/copy_dir_core.cpp index b824647e3..059fc0e6f 100644 --- a/interfaces/kits/js/src/mod_fs/properties/copy_dir_core.cpp +++ b/interfaces/kits/js/src/mod_fs/properties/copy_dir_core.cpp @@ -44,6 +44,7 @@ static bool AllowToCopy(const string &src, const string &dest) HILOGE("Failed to copy file, the same path"); return false; } + if (EndWithSlash(src) ? dest.find(src) == 0 : dest.find(src + "/") == 0) { HILOGE("Failed to copy file, dest is under src"); return false; -- Gitee