diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-01 20:37:42 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-01 20:37:42 +0000 |
commit | 871498e2cede09420fe70fb8aea99725a8422e94 (patch) | |
tree | f83f7cbbac37acfb3e27b877676a8e2fa70deeb3 /lib/Support | |
parent | 7dc7ac3cb20b7ef8e6febe0ac3bc430230f29893 (diff) | |
download | external_llvm-871498e2cede09420fe70fb8aea99725a8422e94.zip external_llvm-871498e2cede09420fe70fb8aea99725a8422e94.tar.gz external_llvm-871498e2cede09420fe70fb8aea99725a8422e94.tar.bz2 |
Support/FileSystem: Fix copy_file implementation to use toNullTerminatedStringRef
instead of toStringRef. The file system APIs need c strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120601 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/Unix/PathV2.inc | 4 | ||||
-rw-r--r-- | lib/Support/Windows/PathV2.inc | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/Support/Unix/PathV2.inc b/lib/Support/Unix/PathV2.inc index d12cd16..0fa4b87 100644 --- a/lib/Support/Unix/PathV2.inc +++ b/lib/Support/Unix/PathV2.inc @@ -71,8 +71,8 @@ error_code copy_file(const Twine &from, const Twine &to, copy_option copt) { // Get arguments. SmallString<128> from_storage; SmallString<128> to_storage; - StringRef f = from.toStringRef(from_storage); - StringRef t = to.toStringRef(to_storage); + StringRef f = from.toNullTerminatedStringRef(from_storage); + StringRef t = to.toNullTerminatedStringRef(to_storage); const size_t buf_sz = 32768; char buffer[buf_sz]; diff --git a/lib/Support/Windows/PathV2.inc b/lib/Support/Windows/PathV2.inc index cb80731..b1f8ae0 100644 --- a/lib/Support/Windows/PathV2.inc +++ b/lib/Support/Windows/PathV2.inc @@ -104,8 +104,8 @@ error_code copy_file(const Twine &from, const Twine &to, copy_option copt) { // Get arguments. SmallString<128> from_storage; SmallString<128> to_storage; - StringRef f = from.toStringRef(from_storage); - StringRef t = to.toStringRef(to_storage); + StringRef f = from.toNullTerminatedStringRef(from_storage); + StringRef t = to.toNullTerminatedStringRef(to_storage); // Convert to utf-16. SmallVector<wchar_t, 128> wide_from; |