diff options
| author | Ben Straub <bs@github.com> | 2013-08-05 11:41:39 -0700 |
|---|---|---|
| committer | Ben Straub <bs@github.com> | 2013-08-05 11:41:39 -0700 |
| commit | d85636190f127efa2ec4a6593124c037dfec0ba9 (patch) | |
| tree | 1c19c3cd463e69472d6d58cebd560d8ec025796e /src/win32/dir.c | |
| parent | 9b7d02ff2d9b87d61778ee7ef5e2d43bf4c561f0 (diff) | |
| download | libgit2-d85636190f127efa2ec4a6593124c037dfec0ba9.tar.gz | |
Split UTF-16 and UTF-8 buffer sizes for win32
Also fixed up call-sites to use the correct buffer sizes, especially
when converting to utf-8.
Diffstat (limited to 'src/win32/dir.c')
| -rw-r--r-- | src/win32/dir.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/win32/dir.c b/src/win32/dir.c index 8c51d8378..b18c603f7 100644 --- a/src/win32/dir.c +++ b/src/win32/dir.c @@ -25,8 +25,8 @@ static int init_filter(char *filter, size_t n, const char *dir) git__DIR *git__opendir(const char *dir) { - char filter[GIT_WIN_PATH]; - wchar_t filter_w[GIT_WIN_PATH]; + char filter[GIT_WIN_PATH_UTF8]; + wchar_t filter_w[GIT_WIN_PATH_UTF16]; git__DIR *new = NULL; if (!dir || !init_filter(filter, sizeof(filter), dir)) @@ -40,7 +40,7 @@ git__DIR *git__opendir(const char *dir) if (!new->dir) goto fail; - git__utf8_to_16(filter_w, GIT_WIN_PATH, filter); + git__utf8_to_16(filter_w, GIT_WIN_PATH_UTF16, filter); new->h = FindFirstFileW(filter_w, &new->f); if (new->h == INVALID_HANDLE_VALUE) { @@ -101,8 +101,8 @@ struct git__dirent *git__readdir(git__DIR *d) void git__rewinddir(git__DIR *d) { - char filter[GIT_WIN_PATH]; - wchar_t filter_w[GIT_WIN_PATH]; + char filter[GIT_WIN_PATH_UTF8]; + wchar_t filter_w[GIT_WIN_PATH_UTF16]; if (!d) return; @@ -116,7 +116,7 @@ void git__rewinddir(git__DIR *d) if (!init_filter(filter, sizeof(filter), d->dir)) return; - git__utf8_to_16(filter_w, GIT_WIN_PATH, filter); + git__utf8_to_16(filter_w, GIT_WIN_PATH_UTF16, filter); d->h = FindFirstFileW(filter_w, &d->f); if (d->h == INVALID_HANDLE_VALUE) |
