summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/FileSpec.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2014-12-01 23:13:32 +0000
committerZachary Turner <zturner@google.com>2014-12-01 23:13:32 +0000
commitc7a17ed460928c5094dff6e7b5862ba507ff6f37 (patch)
treea5b874f23f00bb0411c4fde2000dd5aa51f667f5 /lldb/source/Host/common/FileSpec.cpp
parent719f58c22880382fb1669c6a517b112bbc3a2fb7 (diff)
downloadbcm5719-llvm-c7a17ed460928c5094dff6e7b5862ba507ff6f37.tar.gz
bcm5719-llvm-c7a17ed460928c5094dff6e7b5862ba507ff6f37.zip
Only normalize FileSpec paths *after* resolving them.
Normalizing paths before resolving them can cause the path to become denormalized after resolution. llvm-svn: 223087
Diffstat (limited to 'lldb/source/Host/common/FileSpec.cpp')
-rw-r--r--lldb/source/Host/common/FileSpec.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp
index 1678e98aba7..7cd7729f4c3 100644
--- a/lldb/source/Host/common/FileSpec.cpp
+++ b/lldb/source/Host/common/FileSpec.cpp
@@ -268,14 +268,18 @@ FileSpec::SetFile (const char *pathname, bool resolve, PathSyntax syntax)
return;
llvm::SmallString<64> normalized(pathname);
- Normalize(normalized, syntax);
if (resolve)
{
FileSpec::Resolve (normalized);
m_is_resolved = true;
}
-
+
+ // Only normalize after resolving the path. Resolution will modify the path
+ // string, potentially adding wrong kinds of slashes to the path, that need
+ // to be re-normalized.
+ Normalize(normalized, syntax);
+
llvm::StringRef resolve_path_ref(normalized.c_str());
llvm::StringRef filename_ref = llvm::sys::path::filename(resolve_path_ref);
if (!filename_ref.empty())
OpenPOWER on IntegriCloud