summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Path.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r--llvm/lib/Support/Path.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index cf467381db8..75fd292e5b1 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/lib/Support/Path.cpp
@@ -889,8 +889,7 @@ std::error_code is_other(const Twine &Path, bool &Result) {
}
void directory_entry::replace_filename(const Twine &filename, file_status st) {
- SmallString<128> path(Path.begin(), Path.end());
- path::remove_filename(path);
+ SmallString<128> path = path::parent_path(Path);
path::append(path, filename);
Path = path.str();
Status = st;
OpenPOWER on IntegriCloud