diff options
author | Justus Winter <[email protected]> | 2016-03-02 13:14:33 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2016-03-02 13:14:33 +0000 |
commit | e77c85577d1bdd77ad3b81907145fd68f2653c01 (patch) | |
tree | 4c6fc3f74de8d0f052bdbd3ec0de407958be2821 /sm/server.c | |
parent | dirmngr: Add missing CFLAGS. (diff) | |
download | gnupg-e77c85577d1bdd77ad3b81907145fd68f2653c01.tar.gz gnupg-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 <[email protected]>
Diffstat (limited to 'sm/server.c')
-rw-r--r-- | sm/server.c | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/sm/server.c b/sm/server.c index e21c6a4f5..a43ff3472 100644 --- a/sm/server.c +++ b/sm/server.c @@ -30,6 +30,7 @@ #include "gpgsm.h" #include <assuan.h> #include "sysutils.h" +#include "server-help.h" #define set_error(e,t) assuan_set_error (ctx, gpg_error (e), (t)) @@ -95,38 +96,6 @@ strcpy_escaped_plus (char *d, const char *s) } -/* 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))); -} - - /* A write handler used by es_fopencookie to write assuan data lines. */ static gpgrt_ssize_t |