diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2024-12-20 03:45:45 +0100 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2024-12-20 03:45:45 +0100 |
commit | ab8a2408a3908693cd8fa9a21bb60efdb245e03a (patch) | |
tree | f5f286bbe03771c3a0bc17c55bac9c25e8ab8fb4 | |
parent | agent: Clean up for the refactoring. (diff) | |
download | gnupg2-ab8a2408a3908693cd8fa9a21bb60efdb245e03a.tar.xz gnupg2-ab8a2408a3908693cd8fa9a21bb60efdb245e03a.zip |
scd: Use gpgrt_spawn_actions_set_env_rev to have clean semantics.
* scd/app.c (report_change): Use gpgrt_spawn_actions_set_env_rev.
--
It's UTF-8 string.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r-- | scd/app.c | 14 |
1 files changed, 3 insertions, 11 deletions
@@ -2494,12 +2494,7 @@ report_change (int slot, int old_status, int cur_status) xfree (fname); homestr = make_filename (gnupg_homedir (), NULL); -#ifdef HAVE_W32_SYSTEM - /* An environment block is terminated by two zero bytes. */ - if (gpgrt_asprintf (&envstr, "GNUPGHOME=%s%c", homestr, 0) < 0) -#else if (gpgrt_asprintf (&envstr, "GNUPGHOME=%s", homestr) < 0) -#endif log_error ("out of core while building environment\n"); else { @@ -2527,12 +2522,9 @@ report_change (int slot, int old_status, int cur_status) err = gpgrt_spawn_actions_new (&act); if (!err) { -#ifdef HAVE_W32_SYSTEM - gpgrt_spawn_actions_set_envvars (act, envstr); -#else - char *env[2] = { envstr, NULL }; - gpgrt_spawn_actions_set_environ (act, env); -#endif + const char *envchange[2] = { envstr, NULL }; + + gpgrt_spawn_actions_set_env_rev (act, envchange); err = gpgrt_process_spawn (fname, args, GPGRT_PROCESS_DETACHED, act, NULL); gpgrt_spawn_actions_release (act); |