summaryrefslogtreecommitdiff
path: root/src/path.c
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2012-09-04 14:19:24 -0700
committerVicent Martí <vicent@github.com>2012-09-04 14:19:24 -0700
commit4d3834038bd0aaef63d62c54900f6ddafec09515 (patch)
treee1cc8e3bc55d73e3e00f876a220fcfc462938f60 /src/path.c
parentc9d223f0de390e8b28af7c7513d03340001c2580 (diff)
parent0f4c61754bd123b3bee997b397187c9b813ca3e4 (diff)
downloadlibgit2-4d3834038bd0aaef63d62c54900f6ddafec09515.tar.gz
Merge pull request #856 from libgit2/utf8-win
Windows: Perform UTF-8 path conversion on the Stack
Diffstat (limited to 'src/path.c')
-rw-r--r--src/path.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/path.c b/src/path.c
index 15188850..09556bd3 100644
--- a/src/path.c
+++ b/src/path.c
@@ -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;
}