Make sure FileSystem::Resolve preserves the path/file distinction.
authorAdrian Prantl <aprantl@apple.com>
Wed, 13 Mar 2019 15:54:18 +0000 (15:54 +0000)
committerAdrian Prantl <aprantl@apple.com>
Wed, 13 Mar 2019 15:54:18 +0000 (15:54 +0000)
This should finally fix TestPaths.py.

llvm-svn: 356057

lldb/source/Host/common/FileSystem.cpp

index 7ce8634..0c88405 100644 (file)
@@ -264,7 +264,10 @@ void FileSystem::Resolve(FileSpec &file_spec) {
   Resolve(path);
 
   // Update the FileSpec with the resolved path.
-  file_spec.SetPath(path);
+  if (file_spec.GetFilename().IsEmpty())
+    file_spec.GetDirectory().SetString(path);
+  else
+    file_spec.SetPath(path);
   file_spec.SetIsResolved(true);
 }