Changeset 217771 in webkit for trunk/Source/JavaScriptCore/jsc.cpp
- Timestamp:
- Jun 4, 2017, 9:38:39 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jsc.cpp
r217523 r217771 97 97 #if OS(WINDOWS) 98 98 #include <direct.h> 99 #include <wtf/text/win/WCharStringExtras.h> 99 100 #else 100 101 #include <unistd.h> … … 1568 1569 auto buffer = std::make_unique<wchar_t[]>(bufferLength); 1569 1570 DWORD lengthNotIncludingNull = ::GetCurrentDirectoryW(bufferLength, buffer.get()); 1570 static_assert(sizeof(wchar_t) == sizeof(UChar), "In Windows, both are UTF-16LE"); 1571 String directoryString = String(reinterpret_cast<UChar*>(buffer.get())); 1571 String directoryString = nullTerminatedWCharToString(buffer.get()); 1572 1572 // We don't support network path like \\host\share\<path name>. 1573 1573 if (directoryString.startsWith("\\\\")) … … 1746 1746 // Use long UNC to pass the long path name to the Windows APIs. 1747 1747 String longUNCPathName = WTF::makeString("\\\\?\\", fileName); 1748 static_assert(sizeof(wchar_t) == sizeof(UChar), "In Windows, both are UTF-16LE"); 1749 auto utf16Vector = longUNCPathName.charactersWithNullTermination(); 1750 FILE* f = _wfopen(reinterpret_cast<wchar_t*>(utf16Vector.data()), L"rb"); 1748 FILE* f = _wfopen(stringToNullTerminatedWChar(longUNCPathName).data(), L"rb"); 1751 1749 #else 1752 1750 FILE* f = fopen(fileName.utf8().data(), "r");
Note:
See TracChangeset
for help on using the changeset viewer.