summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/FileSpec.cpp
diff options
context:
space:
mode:
authorVirgile Bello <virgile.bello@gmail.com>2013-09-20 22:31:10 +0000
committerVirgile Bello <virgile.bello@gmail.com>2013-09-20 22:31:10 +0000
commit1fd7ec75fcae2966530830df4a8c6a983733f515 (patch)
tree9df7ffee8152909c4a0ce9ad86171124200dfcb1 /lldb/source/Host/common/FileSpec.cpp
parent3036a8517f859e436fb75a0eacebe95f185a495c (diff)
downloadbcm5719-llvm-1fd7ec75fcae2966530830df4a8c6a983733f515.tar.gz
bcm5719-llvm-1fd7ec75fcae2966530830df4a8c6a983733f515.zip
Add backslash as path separator for Win32.
llvm-svn: 191115
Diffstat (limited to 'lldb/source/Host/common/FileSpec.cpp')
-rw-r--r--lldb/source/Host/common/FileSpec.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp
index 66818453bc0..4b8037aef11 100644
--- a/lldb/source/Host/common/FileSpec.cpp
+++ b/lldb/source/Host/common/FileSpec.cpp
@@ -328,7 +328,11 @@ FileSpec::SetFile (const char *pathname, bool resolve)
// Truncate the basename off the end of the resolved path
// Only attempt to get the dirname if it looks like we have a path
- if (strchr(resolved_path, '/'))
+ if (strchr(resolved_path, '/')
+#ifdef _WIN32
+ || strchr(resolved_path, '\\')
+#endif
+ )
{
char *directory = ::dirname (resolved_path);
@@ -339,6 +343,11 @@ FileSpec::SetFile (const char *pathname, bool resolve)
else
{
char *last_resolved_path_slash = strrchr(resolved_path, '/');
+#ifdef _WIN32
+ char* last_resolved_path_slash_windows = strrchr(resolved_path, '\\');
+ if (last_resolved_path_slash_windows > last_resolved_path_slash)
+ last_resolved_path_slash = last_resolved_path_slash_windows;
+#endif
if (last_resolved_path_slash)
{
*last_resolved_path_slash = '\0';
OpenPOWER on IntegriCloud