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 | bab2d49d4aecd83de25dfdefed0c4e4b03957de1 (patch) | |
tree | 9ae3c3de9433d56cd535923b115b77e1dc5429af /lib/Support/Windows/PathV2.inc | |
parent | bfb25cd97ce21f511f8bcbcff57c11aade502d5b (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127724 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Windows/PathV2.inc')
-rw-r--r-- | lib/Support/Windows/PathV2.inc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Support/Windows/PathV2.inc b/lib/Support/Windows/PathV2.inc index 8f306d19fe..af71b73cd6 100644 --- a/lib/Support/Windows/PathV2.inc +++ b/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; |