diff options
author | Russell Belfer <rb@github.com> | 2012-11-14 22:41:51 -0800 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-11-14 22:41:51 -0800 |
commit | cccacac555ed3937204f8dfd397bc92e499d2c42 (patch) | |
tree | f2dbc74e6a27f330156d94e407307a954d6cbb37 /src/win32/utf-conv.c | |
parent | a277345e05507dfa0a3350d47df96d37063c929f (diff) | |
download | libgit2-cccacac555ed3937204f8dfd397bc92e499d2c42.tar.gz |
Add POSIX compat lstat() variant for win32
The existing p_lstat implementation on win32 is not quite POSIX
compliant when setting errno to ENOTDIR. This adds an option to
make is be compliant so that code (such as checkout) that cares
to have separate behavior for ENOTDIR can use it portably.
This also contains a couple of other minor cleanups in the
posix_w32.c implementations to avoid unnecessary work.
Diffstat (limited to 'src/win32/utf-conv.c')
-rw-r--r-- | src/win32/utf-conv.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/win32/utf-conv.c b/src/win32/utf-conv.c index 396af7cad..0659a5d1c 100644 --- a/src/win32/utf-conv.c +++ b/src/win32/utf-conv.c @@ -70,12 +70,12 @@ void git__utf8_to_16(wchar_t *dest, size_t length, const char *src) } #endif -void git__utf8_to_16(wchar_t *dest, size_t length, const char *src) +int git__utf8_to_16(wchar_t *dest, size_t length, const char *src) { - MultiByteToWideChar(CP_UTF8, 0, src, -1, dest, (int)length); + return MultiByteToWideChar(CP_UTF8, 0, src, -1, dest, (int)length); } -void git__utf16_to_8(char *out, const wchar_t *input) +int git__utf16_to_8(char *out, const wchar_t *input) { - WideCharToMultiByte(CP_UTF8, 0, input, -1, out, GIT_WIN_PATH, NULL, NULL); + return WideCharToMultiByte(CP_UTF8, 0, input, -1, out, GIT_WIN_PATH, NULL, NULL); } |