Commit 3ae0aad7 by Russell Belfer

Move error capture to top of giterr_set

parent 1362a983
...@@ -40,17 +40,17 @@ void giterr_set(int error_class, const char *string, ...) ...@@ -40,17 +40,17 @@ void giterr_set(int error_class, const char *string, ...)
{ {
git_buf buf = GIT_BUF_INIT; git_buf buf = GIT_BUF_INIT;
va_list arglist; va_list arglist;
#ifdef GIT_WIN32
DWORD win32_error_code = (error_class == GITERR_OS) ? GetLastError() : 0;
#endif
int error_code = (error_class == GITERR_OS) ? errno : 0;
va_start(arglist, string); va_start(arglist, string);
git_buf_vprintf(&buf, string, arglist); git_buf_vprintf(&buf, string, arglist);
va_end(arglist); va_end(arglist);
if (error_class == GITERR_OS) { if (error_class == GITERR_OS) {
int error_code = errno;
#ifdef GIT_WIN32 #ifdef GIT_WIN32
DWORD win32_error_code = GetLastError();
if (win32_error_code) { if (win32_error_code) {
char *lpMsgBuf; char *lpMsgBuf;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment