diff options
author | Zachary Turner <zturner@google.com> | 2014-08-07 17:33:36 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2014-08-07 17:33:36 +0000 |
commit | 3f55974024d9178825e73bdd0e97f19fba67a2b7 (patch) | |
tree | b0d8adcd58ae949813c71eda11fb3e757c57390c /lldb/source/API/SBFileSpec.cpp | |
parent | df62f20c75d0984aac06b8b998988eb91262e43c (diff) | |
download | bcm5719-llvm-3f55974024d9178825e73bdd0e97f19fba67a2b7.tar.gz bcm5719-llvm-3f55974024d9178825e73bdd0e97f19fba67a2b7.zip |
Optimizations for FileSpec.
llvm-svn: 215124
Diffstat (limited to 'lldb/source/API/SBFileSpec.cpp')
-rw-r--r-- | lldb/source/API/SBFileSpec.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lldb/source/API/SBFileSpec.cpp b/lldb/source/API/SBFileSpec.cpp index 0de1c245846..8d63fc587d8 100644 --- a/lldb/source/API/SBFileSpec.cpp +++ b/lldb/source/API/SBFileSpec.cpp @@ -16,6 +16,8 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Stream.h" +#include "llvm/ADT/SmallString.h" + using namespace lldb; using namespace lldb_private; @@ -89,7 +91,11 @@ SBFileSpec::ResolveExecutableLocation () int SBFileSpec::ResolvePath (const char *src_path, char *dst_path, size_t dst_len) { - return lldb_private::FileSpec::Resolve (src_path, dst_path, dst_len); + llvm::SmallString<64> result(src_path); + lldb_private::FileSpec::Resolve (result); + size_t result_length = std::min(dst_len-1, result.size()); + ::strncpy(dst_path, result.c_str(), result_length + 1); + return result_length; } const char * |