diff options
Diffstat (limited to 'lldb/source/Host/common/FileSpec.cpp')
-rw-r--r-- | lldb/source/Host/common/FileSpec.cpp | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp index 0af0556d30c..7cd7729f4c3 100644 --- a/lldb/source/Host/common/FileSpec.cpp +++ b/lldb/source/Host/common/FileSpec.cpp @@ -1340,31 +1340,18 @@ FileSpec::IsSourceImplementationFile () const bool FileSpec::IsRelativeToCurrentWorkingDirectory () const { - const char *dir = m_directory.GetCString(); - llvm::StringRef directory(dir ? dir : ""); - - if (directory.size() > 0) + const char *directory = m_directory.GetCString(); + if (directory && directory[0]) { - if (m_syntax == ePathSyntaxWindows) + // If the path doesn't start with '/' or '~', return true + switch (directory[0]) { - if (directory.size() >= 2 && directory[1] == ':') - return false; - if (directory[0] == '/') - return false; + case '/': + case '~': + return false; + default: return true; } - else - { - // If the path doesn't start with '/' or '~', return true - switch (directory[0]) - { - case '/': - case '~': - return false; - default: - return true; - } - } } else if (m_filename) { |