diff options
author | Jim Ingham <jingham@apple.com> | 2014-12-06 01:41:10 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2014-12-06 01:41:10 +0000 |
commit | 4623b9d3e2bf1d19a46461745b9cf1047e67abd2 (patch) | |
tree | 52c5a214086d98150079a318dea4cae86058fb41 /lldb/source/Host/common/FileSpec.cpp | |
parent | 8b54286d1c31dc6a870823ce9532b38b9477ad52 (diff) | |
download | bcm5719-llvm-4623b9d3e2bf1d19a46461745b9cf1047e67abd2.tar.gz bcm5719-llvm-4623b9d3e2bf1d19a46461745b9cf1047e67abd2.zip |
Reverting r223548 which broke running in the shell on OS X.
llvm-svn: 223568
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) { |