From 56a77f57db90171a1437b1e2cb1211d0a34d688a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 26 Oct 2020 10:19:58 +0100 Subject: [PATCH] common: Fix gnupg_access for older libgpg-error. -- Fixes-commit: dd5fd4a760b8cf6ae05ff878bcf36cf2465e744c --- common/sysutils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/sysutils.c b/common/sysutils.c index acfea7db6..05fadb3d7 100644 --- a/common/sysutils.c +++ b/common/sysutils.c @@ -1137,8 +1137,9 @@ gnupg_access (const char *name, int mode) #if GPGRT_VERSION_NUMBER < 0x012800 /* 1.40 */ # ifdef HAVE_W32_SYSTEM wchar_t *wfname; + gpg_err_code_t ec; - wfname = utf8_to_wchar (fname); + wfname = utf8_to_wchar (name); if (!wfname) ec = gpg_err_code_from_syserror (); else @@ -1146,6 +1147,7 @@ gnupg_access (const char *name, int mode) ec = _waccess (wfname, mode)? gpg_err_code_from_syserror () : 0; xfree (wfname); } + return ec; # else return access (name, mode)? gpg_err_code_from_syserror () : 0; # endif