mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 09:09:33 +00:00
Move error capture to top of giterr_set
This commit is contained in:
parent
1362a98316
commit
3ae0aad75a
@ -40,17 +40,17 @@ void giterr_set(int error_class, const char *string, ...)
|
||||
{
|
||||
git_buf buf = GIT_BUF_INIT;
|
||||
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);
|
||||
git_buf_vprintf(&buf, string, arglist);
|
||||
va_end(arglist);
|
||||
|
||||
if (error_class == GITERR_OS) {
|
||||
int error_code = errno;
|
||||
|
||||
#ifdef GIT_WIN32
|
||||
DWORD win32_error_code = GetLastError();
|
||||
|
||||
if (win32_error_code) {
|
||||
char *lpMsgBuf;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user