diff options
Diffstat (limited to 'src/path.c')
-rw-r--r-- | src/path.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -432,14 +432,14 @@ bool git_path_is_empty_dir(const char *path) { git_buf pathbuf = GIT_BUF_INIT; HANDLE hFind = INVALID_HANDLE_VALUE; - wchar_t *wbuf; + wchar_t wbuf[GIT_WIN_PATH]; WIN32_FIND_DATAW ffd; bool retval = true; if (!git_path_isdir(path)) return false; git_buf_printf(&pathbuf, "%s\\*", path); - wbuf = gitwin_to_utf16(git_buf_cstr(&pathbuf)); + git__utf8_to_16(wbuf, GIT_WIN_PATH, git_buf_cstr(&pathbuf)); hFind = FindFirstFileW(wbuf, &ffd); if (INVALID_HANDLE_VALUE == hFind) { @@ -455,7 +455,6 @@ bool git_path_is_empty_dir(const char *path) FindClose(hFind); git_buf_free(&pathbuf); - git__free(wbuf); return retval; } |