Skip to content

Commit

Permalink
Merge pull request sass#501 from vadimi/master
Browse files Browse the repository at this point in the history
Fix CreateFileW function usage, otherwise it fails to open file.
  • Loading branch information
HamptonMakes committed Oct 4, 2014
2 parents 296ccdc + 3214782 commit c31087c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ namespace Sass {
BYTE* pBuffer;
DWORD dwBytes;
// windows unicode filepaths are encoded in utf16
const wchar_t* wpath = UTF_8::convert_to_utf16(path).c_str();
HANDLE hFile = CreateFileW(wpath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
wstring wpath = UTF_8::convert_to_utf16(path);
HANDLE hFile = CreateFileW(wpath.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if (hFile == INVALID_HANDLE_VALUE) return 0;
DWORD dwFileLength = GetFileSize(hFile, NULL);
if (dwFileLength == INVALID_FILE_SIZE) return 0;
Expand Down

0 comments on commit c31087c

Please sign in to comment.