From 0a25beac9645c61502073fa0d7c72de95184307a Mon Sep 17 00:00:00 2001 From: A_Wei Date: Tue, 16 Apr 2024 10:36:51 +0800 Subject: [PATCH] =?UTF-8?q?[LLDB]=20Fixed=20file=20paths=20with=20spaces?= =?UTF-8?q?=20cannot=20pull=20so=20Description:=20Add=20"=20to=20the=20pat?= =?UTF-8?q?h=20when=20calling=20the=20hdc=20command=20Issue=EF=BC=9A=20htt?= =?UTF-8?q?ps://gitee.com/openharmony/third=5Fparty=5Fllvm-project/issues/?= =?UTF-8?q?I9GYOS=3Ffrom=3Dproject-issue=20Test:=20Files=20in=20paths=20wi?= =?UTF-8?q?th=20spaces=20can=20be=20obtained=20through=20hdc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: A_Wei Change-Id: 4da90238afc0f6332df140c3f9cd4b82aaf3bbde --- lldb/source/Plugins/Platform/OHOS/HdcClient.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lldb/source/Plugins/Platform/OHOS/HdcClient.cpp b/lldb/source/Plugins/Platform/OHOS/HdcClient.cpp index 679b821f2d08..bcac55f04b7d 100644 --- a/lldb/source/Plugins/Platform/OHOS/HdcClient.cpp +++ b/lldb/source/Plugins/Platform/OHOS/HdcClient.cpp @@ -290,7 +290,7 @@ Status HdcClient::LocalTransferFile(const char *direction, const FileSpec &src, std::stringstream cmd; cmd << "file " << direction << " -m " << " -cwd "; cmd.write(cwd.data(), cwd.size()); - cmd << " " << src.GetPath() << " " << dst.GetPath(); + cmd << " \"" << src.GetPath() << "\" \"" << dst.GetPath() << "\""; Status error = SendMessage(cmd.str()); if (error.Fail()) return error; @@ -594,7 +594,7 @@ Status HdcClient::RecvFile(const FileSpec &src, const FileSpec &dst) { std::stringstream cmd; cmd << "file recv remote -m"; - cmd << " " << src.GetPath() << " " << dst.GetPath(); + cmd << " \"" << src.GetPath() << "\" \"" << dst.GetPath() << "\""; Status error = SendMessage(cmd.str()); if (error.Fail()) return error; @@ -701,7 +701,7 @@ Status HdcClient::SendFile(const FileSpec &src, const FileSpec &dst) { return Status("Unable to open local file %s", local_file_path.c_str()); std::stringstream cmd; - cmd << "file send remote -m " << src.GetPath() << " " << dst.GetPath(); + cmd << "file send remote -m \"" << src.GetPath() << "\" \"" << dst.GetPath() << "\""; Status error = SendMessage(cmd.str()); if (error.Fail()) return error; -- Gitee