Imported Upstream version 2.1.13
[platform/upstream/gpg2.git] / g10 / server.c
index d02f20e..771a8a7 100644 (file)
@@ -32,6 +32,7 @@
 #include "util.h"
 #include "i18n.h"
 #include "options.h"
+#include "../common/server-help.h"
 #include "../common/sysutils.h"
 #include "status.h"
 
@@ -68,40 +69,6 @@ close_message_fd (ctrl_t ctrl)
     }
 }
 
-
-/* Skip over options.  Blanks after the options are also removed.  */
-static char *
-skip_options (const char *line)
-{
-  while (spacep (line))
-    line++;
-  while ( *line == '-' && line[1] == '-' )
-    {
-      while (*line && !spacep (line))
-        line++;
-      while (spacep (line))
-        line++;
-    }
-  return (char*)line;
-}
-
-
-/* Check whether the option NAME appears in LINE.  */
-static int
-has_option (const char *line, const char *name)
-{
-  const char *s;
-  int n = strlen (name);
-
-  s = strstr (line, name);
-  if (s && s >= skip_options (line))
-    return 0;
-  return (s && (s == line || spacep (s-1)) && (!s[n] || spacep (s+n)));
-}
-
-
-
-
 \f
 /* Called by libassuan for Assuan options.  See the Assuan manual for
    details. */
@@ -257,7 +224,7 @@ cmd_recipient (assuan_context_t ctx, char *line)
    then not be done for this key.  If the policy is not to sign at all
    if not all signer keys are valid, the client has to take care of
    this.  All SIGNER commands are cumulative until a RESET but they
-   are *not* reset by an SIGN command becuase it can be expected that
+   are *not* reset by an SIGN command because it can be expected that
    set of signers are used for more than one sign operation.
 
    Note that this command returns an INV_RECP status which is a bit
@@ -623,7 +590,8 @@ cmd_passwd (assuan_context_t ctx, char *line)
   gpg_error_t err;
 
   (void)ctx;
-  line = skip_options (line);
+  (void)line;
+  /* line = skip_options (line); */
 
   err = gpg_error (GPG_ERR_NOT_SUPPORTED);
 
@@ -727,12 +695,12 @@ gpg_server (ctrl_t ctrl)
   assuan_set_pointer (ctx, ctrl);
   if (opt.verbose || opt.debug)
     {
-      char *tmp = NULL;
+      char *tmp;
 
       tmp = xtryasprintf ("Home: %s\n"
                           "Config: %s\n"
                           "%s",
-                          opt.homedir,
+                          gnupg_homedir (),
                           "fixme: need config filename",
                           hello);
       if (tmp)