Skip to content

Commit c7428c1

Browse files
author
git apple-llvm automerger
committed
Merge commit 'e28f4846296a' from apple/master into swift/master-next
2 parents 7e1fd91 + e28f484 commit c7428c1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lldb/source/Initialization/SystemInitializerCommon.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,10 @@ llvm::Error SystemInitializerCommon::Initialize() {
8080
}
8181
if (llvm::Expected<std::string> cwd =
8282
loader->LoadBuffer<WorkingDirectoryProvider>()) {
83-
cwd->erase(std::remove_if(cwd->begin(), cwd->end(),
84-
[](char c) { return std::iscntrl(c); }),
85-
cwd->end());
83+
llvm::StringRef working_dir = llvm::StringRef(*cwd).rtrim();
8684
if (std::error_code ec = FileSystem::Instance()
8785
.GetVirtualFileSystem()
88-
->setCurrentWorkingDirectory(*cwd)) {
86+
->setCurrentWorkingDirectory(working_dir)) {
8987
return llvm::errorCodeToError(ec);
9088
}
9189
} else {

0 commit comments

Comments
 (0)