mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* main.h, misc.c (optsep, argsplit, optlen, parse_options): Simplify code
and properly handle a partial match against an option with an argument. * keyserver-internal.h, keyserver.c (parse_keyserver_options): Use new optsep and argsplit functions.
This commit is contained in:
parent
2936e539cc
commit
0a17966a21
5 changed files with 62 additions and 37 deletions
|
@ -70,12 +70,13 @@ static struct parse_options keyserver_opts[]=
|
|||
static int keyserver_work(int action,STRLIST list,
|
||||
KEYDB_SEARCH_DESC *desc,int count);
|
||||
|
||||
void
|
||||
int
|
||||
parse_keyserver_options(char *options)
|
||||
{
|
||||
char *tok,*arg;
|
||||
int ret=1;
|
||||
char *tok;
|
||||
|
||||
while((tok=argsep(&options,&arg)))
|
||||
while((tok=optsep(&options)))
|
||||
{
|
||||
if(tok[0]=='\0')
|
||||
continue;
|
||||
|
@ -108,6 +109,7 @@ parse_keyserver_options(char *options)
|
|||
{
|
||||
/* All of the standard options have failed, so the option is
|
||||
destined for a keyserver plugin. */
|
||||
char *arg=argsplit(tok);
|
||||
|
||||
if(arg)
|
||||
{
|
||||
|
@ -126,6 +128,8 @@ parse_keyserver_options(char *options)
|
|||
add_to_strlist(&opt.keyserver_options.other,tok);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct keyserver_spec *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue