summaryrefslogtreecommitdiff
path: root/src/win32/utf-conv.c
diff options
context:
space:
mode:
authorPhilip Kelley <phkelley@hotmail.com>2014-04-22 10:21:19 -0400
committerPhilip Kelley <phkelley@hotmail.com>2014-04-23 09:23:50 -0400
commit7110000dd5b82c86863633ee37f72ac876a44476 (patch)
tree72a8e3ccc4ff2e3e016a3e97933ac44f7d557f0c /src/win32/utf-conv.c
parent65477db1660273c453c590b8e3b97a4f7c41df61 (diff)
downloadlibgit2-7110000dd5b82c86863633ee37f72ac876a44476.tar.gz
React to feedback for UTF-8 <-> WCHAR and reparse work
Diffstat (limited to 'src/win32/utf-conv.c')
-rw-r--r--src/win32/utf-conv.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/win32/utf-conv.c b/src/win32/utf-conv.c
index fe94701a8..b9ccfb5e5 100644
--- a/src/win32/utf-conv.c
+++ b/src/win32/utf-conv.c
@@ -9,7 +9,7 @@
#include "utf-conv.h"
#ifndef WC_ERR_INVALID_CHARS
-#define WC_ERR_INVALID_CHARS 0x80
+# define WC_ERR_INVALID_CHARS 0x80
#endif
GIT_INLINE(DWORD) get_wc_flags(void)
@@ -87,12 +87,8 @@ int git__utf8_to_16_alloc(wchar_t **dest, const char *src)
utf16_size = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, src, -1, *dest, utf16_size);
if (!utf16_size) {
- /* Don't let git__free stomp on the thread-local last error code,
- * so that the caller can call giterr_set(GITERR_OS, ...) */
- DWORD last_error = GetLastError();
git__free(*dest);
*dest = NULL;
- SetLastError(last_error);
}
/* Subtract 1 from the result to turn 0 into -1 (an error code) and to not count the NULL
@@ -131,12 +127,8 @@ int git__utf16_to_8_alloc(char **dest, const wchar_t *src)
utf8_size = WideCharToMultiByte(CP_UTF8, dwFlags, src, -1, *dest, utf8_size, NULL, NULL);
if (!utf8_size) {
- /* Don't let git__free stomp on the thread-local last error code,
- * so that the caller can call giterr_set(GITERR_OS, ...) */
- DWORD last_error = GetLastError();
git__free(*dest);
*dest = NULL;
- SetLastError(last_error);
}
/* Subtract 1 from the result to turn 0 into -1 (an error code) and to not count the NULL