diff options
author | Vicent Martà <vicent@github.com> | 2013-08-13 22:36:24 +0400 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2013-08-13 22:36:24 +0400 |
commit | 40948998badd892754a55197ef1b6b47b107afed (patch) | |
tree | b0cbb27af13b6dda5abff644979afe193a2d7aa8 /src/path.c | |
parent | 14da618260be02c63b4f08dca8e6ab479f7449d7 (diff) | |
parent | 0228a514294bcb9d23bf24c61199a1a3e34d4772 (diff) |
Merge pull request #1767 from libgit2/win32-bigger-utf8-buffer
Bigger buffer for utf-8 parsing in win32
Diffstat (limited to 'src/path.c')
-rw-r--r-- | src/path.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/path.c b/src/path.c index b81675b49..a753a734d 100644 --- a/src/path.c +++ b/src/path.c @@ -8,7 +8,6 @@ #include "path.h" #include "posix.h" #ifdef GIT_WIN32 -#include "win32/dir.h" #include "win32/posix.h" #else #include <dirent.h> @@ -486,24 +485,26 @@ bool git_path_is_empty_dir(const char *path) { git_buf pathbuf = GIT_BUF_INIT; HANDLE hFind = INVALID_HANDLE_VALUE; - wchar_t wbuf[GIT_WIN_PATH]; + git_win32_path wbuf; WIN32_FIND_DATAW ffd; bool retval = true; if (!git_path_isdir(path)) return false; git_buf_printf(&pathbuf, "%s\\*", path); - git__utf8_to_16(wbuf, GIT_WIN_PATH, git_buf_cstr(&pathbuf)); + git_win32_path_from_c(wbuf, git_buf_cstr(&pathbuf)); hFind = FindFirstFileW(wbuf, &ffd); if (INVALID_HANDLE_VALUE == hFind) { giterr_set(GITERR_OS, "Couldn't open '%s'", path); + git_buf_free(&pathbuf); return false; } do { if (!git_path_is_dot_or_dotdotW(ffd.cFileName)) { retval = false; + break; } } while (FindNextFileW(hFind, &ffd) != 0); |