Skip to content

Commit

Permalink
fix compile error on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
idealvin committed Nov 2, 2023
1 parent a2d6a4d commit c0d8f9c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/fs_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ bool mkdir(char* path, bool p) {

inline void pathcat(fastring& s, wchar_t c, const wchar_t* p) {
const wchar_t z = L'\0';
s.append(&c, sizeof(c)).append((char*)p).append(&z, sizeof(z));
const size_t n = wcslen(p) * sizeof(wchar_t);
s.append(&c, sizeof(c)).append((char*)p, n).append(&z, sizeof(z));
s.resize(s.size() - sizeof(z));
}

Expand All @@ -152,7 +153,7 @@ inline bool is_dot_or_dotdot(const wchar_t* p) {
static bool _rmdir(fastring& s, wchar_t c) {
const wchar_t* t = L"*";
const size_t n = s.size();
pathcat(s, c, t)
pathcat(s, c, t);

WIN32_FIND_DATAW e;
HANDLE h = FindFirstFileW((PWC)s.data(), &e);
Expand Down

0 comments on commit c0d8f9c

Please sign in to comment.