Use a default argument for --write-env-file.
authorWerner Koch <wk@gnupg.org>
Tue, 16 Aug 2005 09:15:09 +0000 (09:15 +0000)
committerWerner Koch <wk@gnupg.org>
Tue, 16 Aug 2005 09:15:09 +0000 (09:15 +0000)
NEWS
agent/ChangeLog
agent/gpg-agent.c

diff --git a/NEWS b/NEWS
index f05c17e..e51cade 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Noteworthy changes in version 1.9.19
+-------------------------------------------------
+
+
 Noteworthy changes in version 1.9.18 (2005-08-01)
 -------------------------------------------------
 
index bcb00e3..adb7b1b 100644 (file)
@@ -1,3 +1,7 @@
+2005-08-16  Werner Koch  <wk@g10code.com>
+
+       * gpg-agent.c (main): Use a default file name for --write-env-file.
+
 2005-07-25  Werner Koch  <wk@g10code.com>
 
        * findkey.c (agent_public_key_from_file): Fixed array assignment.
index 8732c98..b6a4f90 100644 (file)
@@ -152,7 +152,7 @@ static ARGPARSE_OPTS opts[] = {
   { oAllowPresetPassphrase, "allow-preset-passphrase", 0,
                              N_("allow presetting passphrase")},
   { oSSHSupport, "enable-ssh-support", 0, N_("enable ssh-agent emulation") },
-  { oWriteEnvFile, "write-env-file", 2,
+  { oWriteEnvFile, "write-env-file", 2|8,
             N_("|FILE|write environment settings also to FILE")},
   {0}
 };
@@ -633,7 +633,12 @@ main (int argc, char **argv )
         case oKeepDISPLAY: opt.keep_display = 1; break;
 
        case oSSHSupport:  opt.ssh_support = 1; break;
-        case oWriteEnvFile: env_file_name = pargs.r.ret_str; break;
+        case oWriteEnvFile:
+          if (pargs.r_type)
+            env_file_name = pargs.r.ret_str;
+          else
+            env_file_name = make_filename ("~/.gpg-agent-info", NULL);
+          break;
 
         default : pargs.err = configfp? 1:2; break;
        }