1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-11-10 21:38:50 +01:00

scd:w32: Fix for setting an environment block with GNUPGHOME.

* scd/app.c (report_change): It's ASCII or multi-byte encoded string.
It's gpgrt's spawn function which converts it to wide char string
internally if needed.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2024-09-06 10:46:36 +09:00
parent c9677e9501
commit 412e183e55
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054

View File

@ -2483,9 +2483,8 @@ report_change (int slot, int old_status, int cur_status)
homestr = make_filename (gnupg_homedir (), NULL); homestr = make_filename (gnupg_homedir (), NULL);
#ifdef HAVE_W32_SYSTEM #ifdef HAVE_W32_SYSTEM
/* An environment block is terminated by two/four zero bytes. It's /* An environment block is terminated by two zero bytes. */
* four zero bytes for Unicode. Let us always use four zero bytes. */ if (gpgrt_asprintf (&envstr, "GNUPGHOME=%s%c", homestr, 0) < 0)
if (gpgrt_asprintf (&envstr, "GNUPGHOME=%s%c%c%c", homestr, 0, 0, 0) < 0)
#else #else
if (gpgrt_asprintf (&envstr, "GNUPGHOME=%s", homestr) < 0) if (gpgrt_asprintf (&envstr, "GNUPGHOME=%s", homestr) < 0)
#endif #endif