summaryrefslogtreecommitdiffstats
path: root/g13
diff options
context:
space:
mode:
authorJustus Winter <justus@g10code.com>2016-03-02 14:14:33 +0100
committerJustus Winter <justus@g10code.com>2016-03-02 14:14:33 +0100
commite77c85577d1bdd77ad3b81907145fd68f2653c01 (patch)
tree4c6fc3f74de8d0f052bdbd3ec0de407958be2821 /g13
parentdirmngr: Add missing CFLAGS. (diff)
downloadgnupg2-e77c85577d1bdd77ad3b81907145fd68f2653c01.tar.xz
gnupg2-e77c85577d1bdd77ad3b81907145fd68f2653c01.zip
common: Consolidate Assuan server argument handling.
* common/Makefile.am (common_sources): Add new files. * common/server-help.c: New file. * common/server-help.h: Likewise. * agent/command.c: Drop argument handling primitives in favor of using the consolidated ones. * dirmngr/server.c: Likewise. * g10/server.c: Likewise. * g13/server.c: Likewise. * scd/command.c: Likewise. * sm/server.c: Likewise. Signed-off-by: Justus Winter <justus@g10code.com>
Diffstat (limited to 'g13')
-rw-r--r--g13/server.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/g13/server.c b/g13/server.c
index 60a69bc6e..33885d64b 100644
--- a/g13/server.c
+++ b/g13/server.c
@@ -33,7 +33,7 @@
#include "create.h"
#include "mount.h"
#include "suspend.h"
-
+#include "../common/server-help.h"
/* The filepointer for status message used in non-server mode */
static FILE *statusfp;
@@ -65,37 +65,6 @@ static int command_has_option (const char *cmd, const char *cmdopt);
#define set_error(e,t) assuan_set_error (ctx, gpg_error (e), (t))
-/* 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))); */
-/* } */
-
-
/* Helper to print a message while leaving a command. */
static gpg_error_t
leave_cmd (assuan_context_t ctx, gpg_error_t err)