mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-18 14:17:03 +01:00
* keyserver.c (strip_leading_space, get_arg): New.
(parse_keyserver_options): Use them here to allow arguments to keyserver-options. Since none of our options need arguments yet, just pass them through whole to the keyserver helper.
This commit is contained in:
parent
392e6da660
commit
0f346cf8c1
@ -1,5 +1,10 @@
|
||||
2003-12-27 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* keyserver.c (strip_leading_space, get_arg): New.
|
||||
(parse_keyserver_options): Use them here to allow arguments to
|
||||
keyserver-options. Since none of our options need arguments yet,
|
||||
just pass them through whole to the keyserver helper.
|
||||
|
||||
* main.h, misc.c (parse_options): Add a "noisy" flag to enable and
|
||||
disable the messages about which option didn't match or matched
|
||||
ambiguously. Change all callers (g10.c, keyserver.c).
|
||||
|
@ -74,6 +74,33 @@ struct kopts
|
||||
static int keyserver_work(int action,STRLIST list,
|
||||
KEYDB_SEARCH_DESC *desc,int count);
|
||||
|
||||
static void
|
||||
strip_leading_space(char **stringp)
|
||||
{
|
||||
while(**stringp)
|
||||
{
|
||||
if(ascii_isspace(**stringp))
|
||||
(*stringp)++;
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static char *
|
||||
get_arg(char **stringp)
|
||||
{
|
||||
strip_leading_space(stringp);
|
||||
|
||||
if(**stringp=='=')
|
||||
{
|
||||
(*stringp)++;
|
||||
strip_leading_space(stringp);
|
||||
return strsep(stringp," ,");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
parse_keyserver_options(char *options)
|
||||
{
|
||||
@ -127,10 +154,27 @@ parse_keyserver_options(char *options)
|
||||
&&
|
||||
!parse_export_options(tok,
|
||||
&opt.keyserver_options.export_options,0))
|
||||
{
|
||||
char *arg;
|
||||
if(options && (arg=get_arg(&options)))
|
||||
{
|
||||
char *joined;
|
||||
|
||||
joined=m_alloc(strlen(tok)+1+strlen(arg)+1);
|
||||
/* Make a canonical name=value form with no
|
||||
spaces */
|
||||
strcpy(joined,tok);
|
||||
strcat(joined,"=");
|
||||
strcat(joined,arg);
|
||||
add_to_strlist(&opt.keyserver_options.other,joined);
|
||||
m_free(joined);
|
||||
}
|
||||
else
|
||||
add_to_strlist(&opt.keyserver_options.other,tok);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
parse_keyserver_uri(char *uri,const char *configname,unsigned int configlineno)
|
||||
|
Loading…
x
Reference in New Issue
Block a user