From aec65a94d8df51606cc75516c7693cdf8b1d6787 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Fri, 26 Aug 2005 04:24:46 +0000 Subject: * ksutil.h, ksutil.c (parse_ks_options): Remove exact-name and exact-email. (classify_ks_search): Mimic the gpg search modes instead with *, =, <, and @. * gpgkeys_ldap.c (search_key), gpgkeys_hkp.c (search_key): Call them here. Suggested by Jason Harris. --- keyserver/ksutil.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'keyserver/ksutil.c') diff --git a/keyserver/ksutil.c b/keyserver/ksutil.c index 287f50224..595637756 100644 --- a/keyserver/ksutil.c +++ b/keyserver/ksutil.c @@ -298,27 +298,6 @@ parse_ks_options(char *line,struct ks_options *opt) return KEYSERVER_NO_MEMORY; } } - else if(strcasecmp(start,"exact-email")==0 - || strcasecmp(start,"exact-mail")==0) - { - if(no) - opt->flags.exact_email=0; - else - { - opt->flags.exact_email=1; - opt->flags.exact_name=0; - } - } - else if(strcasecmp(start,"exact-name")==0) - { - if(no) - opt->flags.exact_name=0; - else - { - opt->flags.exact_name=1; - opt->flags.exact_email=0; - } - } } return -1; @@ -356,6 +335,27 @@ print_nocr(FILE *stream,const char *str) } } +enum ks_search_type +classify_ks_search(const char **search) +{ + switch(**search) + { + default: + return KS_SEARCH_SUBSTR; + case '*': + (*search)++; + return KS_SEARCH_SUBSTR; + case '=': + (*search)++; + return KS_SEARCH_EXACT; + case '<': + return KS_SEARCH_MAIL; + case '@': + (*search)++; + return KS_SEARCH_MAILSUB; + } +} + #if defined (HAVE_LIBCURL) || defined (FAKE_CURL) int curl_err_to_gpg_err(CURLcode error) -- cgit v1.2.3