From 4623b9d3e2bf1d19a46461745b9cf1047e67abd2 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Sat, 6 Dec 2014 01:41:10 +0000 Subject: Reverting r223548 which broke running in the shell on OS X. llvm-svn: 223568 --- lldb/source/Host/common/FileSpec.cpp | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'lldb/source/Host/common/FileSpec.cpp') 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) { -- cgit v1.2.3