vendor/libgit2/src/errors.c in rugged-0.21.1b2 vs vendor/libgit2/src/errors.c in rugged-0.21.2

- old
+ new

@@ -43,31 +43,29 @@ #ifdef GIT_WIN32 DWORD win32_error_code = (error_class == GITERR_OS) ? GetLastError() : 0; #endif int error_code = (error_class == GITERR_OS) ? errno : 0; - if (string) { - va_start(arglist, string); - git_buf_vprintf(&buf, string, arglist); - va_end(arglist); + va_start(arglist, string); + git_buf_vprintf(&buf, string, arglist); + va_end(arglist); - if (error_class == GITERR_OS) - git_buf_PUTS(&buf, ": "); - } - if (error_class == GITERR_OS) { #ifdef GIT_WIN32 char * win32_error = git_win32_get_error_message(win32_error_code); if (win32_error) { + git_buf_PUTS(&buf, ": "); git_buf_puts(&buf, win32_error); git__free(win32_error); SetLastError(0); } else #endif - if (error_code) + if (error_code) { + git_buf_PUTS(&buf, ": "); git_buf_puts(&buf, strerror(error_code)); + } if (error_code) errno = 0; }