diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2011-03-16 02:53:32 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2011-03-16 02:53:32 +0000 |
commit | a3d4749e24b5e60d658979361be1805f67324813 (patch) | |
tree | 4ab434b64022ada6a29c845abff988155292e784 /llvm/lib/Support/Windows | |
parent | aaa9b4f8241b1ef3002fa093ea4a8597e1aa2735 (diff) | |
download | bcm5719-llvm-a3d4749e24b5e60d658979361be1805f67324813.tar.gz bcm5719-llvm-a3d4749e24b5e60d658979361be1805f67324813.zip |
Windows/PathV2.inc: [PR8520] Recognize "NUL" as special (character) file.
FIXME: It is a temporal hack. We should detect as many "special file name" as possible.
llvm-svn: 127724
Diffstat (limited to 'llvm/lib/Support/Windows')
-rw-r--r-- | llvm/lib/Support/Windows/PathV2.inc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Support/Windows/PathV2.inc b/llvm/lib/Support/Windows/PathV2.inc index 8f306d19fe1..af71b73cd69 100644 --- a/llvm/lib/Support/Windows/PathV2.inc +++ b/llvm/lib/Support/Windows/PathV2.inc @@ -449,7 +449,14 @@ error_code status(const Twine &path, file_status &result) { SmallString<128> path_storage; SmallVector<wchar_t, 128> path_utf16; - if (error_code ec = UTF8ToUTF16(path.toStringRef(path_storage), + StringRef path8 = path.toStringRef(path_storage); + // FIXME: We should detect as many "special file name" as possible. + if (path8.compare_lower("nul") == 0) { + result = file_status(file_type::character_file); + return success; + } + + if (error_code ec = UTF8ToUTF16(path8, path_utf16)) return ec; |