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 /g10/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 'g10/server.c')
-rw-r--r-- | g10/server.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/g10/server.c b/g10/server.c index 31e35a905..9ec263f12 100644 --- a/g10/server.c +++ b/g10/server.c @@ -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))); -} - - - - /* Called by libassuan for Assuan options. See the Assuan manual for details. */ |