diff options
author | Werner Koch <[email protected]> | 2016-06-07 08:59:46 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2016-06-07 08:59:46 +0000 |
commit | 22a7ef01aa2c0eb77bcc40174d09104acc35cab1 (patch) | |
tree | 3782b20549fcc48d2598128676227d9a16f785b6 /tools/symcryptrun.c | |
parent | po: Update Japanese translation. (diff) | |
download | gnupg-22a7ef01aa2c0eb77bcc40174d09104acc35cab1.tar.gz gnupg-22a7ef01aa2c0eb77bcc40174d09104acc35cab1.zip |
Replace use of opt.homedir by accessor functions.
* common/homedir.c (the_gnupg_homedir): New var.
(gnupg_set_homedir): New.
(gnupg_homedir): New.
* g10/options.h (struct opt): Remove 'homedir' and replace all users
by the new accessor functions.
* g13/g13-common.h (struct opt): Ditto.
* scd/scdaemon.h (struct opt): Ditto.
* sm/gpgsm.h (struct opt): Ditto.
* dirmngr/dirmngr.h (struct opt): Ditto.
* agent/preset-passphrase.c (opt_homedir): Ditto.
* agent/protect-tool.c (opt_homedir): Ditto.
--
This will make detection of a non-default homedir easier.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'tools/symcryptrun.c')
-rw-r--r-- | tools/symcryptrun.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tools/symcryptrun.c b/tools/symcryptrun.c index 4b90cd267..49c17c511 100644 --- a/tools/symcryptrun.c +++ b/tools/symcryptrun.c @@ -214,7 +214,7 @@ my_strusage (int level) "Call a simple symmetric encryption tool\n"); break; case 31: p = "\nHome: "; break; - case 32: p = opt.homedir; break; + case 32: p = gnupg_homedir (); break; case 33: p = "\n"; break; default: p = NULL; break; @@ -896,8 +896,6 @@ main (int argc, char **argv) i18n_init(); init_common_subsystems (&argc, &argv); - opt.homedir = default_homedir (); - /* Check whether we have a config file given on the commandline */ orig_argc = argc; orig_argv = argv; @@ -915,11 +913,11 @@ main (int argc, char **argv) else if (pargs.r_opt == oNoOptions) default_config = 0; /* --no-options */ else if (pargs.r_opt == oHomedir) - opt.homedir = pargs.r.ret_str; + gnupg_set_homedir (pargs.r.ret_str); } if (default_config) - configname = make_filename (opt.homedir, "symcryptrun.conf", NULL ); + configname = make_filename (gnupg_homedir (), "symcryptrun.conf", NULL ); argc = orig_argc; argv = orig_argv; @@ -1010,7 +1008,7 @@ main (int argc, char **argv) /* Tell simple-pwquery about the the standard socket name. */ { - char *tmp = make_filename (opt.homedir, GPG_AGENT_SOCK_NAME, NULL); + char *tmp = make_filename (gnupg_homedir (), GPG_AGENT_SOCK_NAME, NULL); simple_pw_set_socket (tmp); xfree (tmp); } |