From c9aa5000d70b9d2bae7903074c8f10b75815e01d Mon Sep 17 00:00:00 2001 From: David Shaw Date: Sat, 14 Feb 2004 05:03:45 +0000 Subject: * keyserver.c (argsep): Move to misc.c. * main.h, misc.c (parse_options), export.c (parse_export_options), import.c (parse_import_options), g10.c (main): Use it here to allow for options with optional arguments. Change all callers. --- g10/keyserver.c | 59 --------------------------------------------------------- 1 file changed, 59 deletions(-) (limited to 'g10/keyserver.c') diff --git a/g10/keyserver.c b/g10/keyserver.c index 63287042c..a651f7165 100644 --- a/g10/keyserver.c +++ b/g10/keyserver.c @@ -72,65 +72,6 @@ struct kopts static int keyserver_work(int action,STRLIST list, KEYDB_SEARCH_DESC *desc,int count); -static char * -argsep(char **stringp,char **arg) -{ - char *tok,*next; - - tok=*stringp; - *arg=NULL; - - if(tok) - { - next=strpbrk(tok," ,="); - - if(next) - { - int sawequals=0; - - if(*next=='=') - sawequals=1; - - *next++='\0'; - *stringp=next; - - /* what we need to do now is scan along starting with *next. - If the next character we see (ignoring spaces) is a = - sign, then there is an argument. */ - - while(*next) - { - if(*next=='=') - sawequals=1; - else if(*next!=' ') - break; - next++; - } - - /* At this point, *next is either an empty string, or the - beginning of the next token (which is an argument if - sawequals is true). */ - - if(sawequals) - { - *arg=next; - next=strpbrk(*arg," ,"); - if(next) - { - *next++='\0'; - *stringp=next; - } - else - *stringp=NULL; - } - } - else - *stringp=NULL; - } - - return tok; -} - void parse_keyserver_options(char *options) { -- cgit