[Lldb-commits] [lldb] r191115 - Add backslash as path separator for Win32.
Virgile Bello
virgile.bello at gmail.com
Fri Sep 20 15:31:11 PDT 2013
Author: xen2
Date: Fri Sep 20 17:31:10 2013
New Revision: 191115
URL: http://llvm.org/viewvc/llvm-project?rev=191115&view=rev
Log:
Add backslash as path separator for Win32.
Modified:
lldb/trunk/source/Host/common/FileSpec.cpp
Modified: lldb/trunk/source/Host/common/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=191115&r1=191114&r2=191115&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/FileSpec.cpp (original)
+++ lldb/trunk/source/Host/common/FileSpec.cpp Fri Sep 20 17:31:10 2013
@@ -328,7 +328,11 @@ FileSpec::SetFile (const char *pathname,
// 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,
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';
More information about the lldb-commits
mailing list