aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keyserver.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/keyserver.c')
-rw-r--r--g10/keyserver.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/g10/keyserver.c b/g10/keyserver.c
index 47347e573..423c0eb45 100644
--- a/g10/keyserver.c
+++ b/g10/keyserver.c
@@ -811,8 +811,9 @@ keyserver_search(STRLIST tokens)
return 0;
}
-/* Count is just for cosmetics. If it is too small, it will grow
- safely. If negative it disables the "Key x-y of z" messages. */
+/* Count and searchstr are just for cosmetics. If the count is too
+ small, it will grow safely. If negative it disables the "Key x-y
+ of z" messages. */
void
keyserver_search_prompt(IOBUF buffer,int count,const char *searchstr)
{
@@ -823,13 +824,7 @@ keyserver_search_prompt(IOBUF buffer,int count,const char *searchstr)
char *answer;
if(count==0)
- {
- if(searchstr)
- log_info(_("key \"%s\" not found on keyserver\n"),searchstr);
- else
- log_info(_("key not found on keyserver\n"));
- return;
- }
+ goto notfound;
if(count<0)
{
@@ -857,7 +852,8 @@ keyserver_search_prompt(IOBUF buffer,int count,const char *searchstr)
if(validcount && (i-1)%10==0)
{
printf("Keys %d-%d of %d",i,(i+9<count)?i+9:count,count);
- printf(" for \"%s\"",searchstr);
+ if(searchstr)
+ printf(" for \"%s\"",searchstr);
printf("\n");
}
@@ -871,6 +867,12 @@ keyserver_search_prompt(IOBUF buffer,int count,const char *searchstr)
else
i--;
+ if(rl==0 && i==1)
+ {
+ count=0;
+ break;
+ }
+
if(i%10==0 || rl==0)
{
answer=cpr_get_no_help("keysearch.prompt",
@@ -896,4 +898,14 @@ keyserver_search_prompt(IOBUF buffer,int count,const char *searchstr)
m_free(keyids);
m_free(line);
+
+ notfound:
+ if(count==0)
+ {
+ if(searchstr)
+ log_info(_("key \"%s\" not found on keyserver\n"),searchstr);
+ else
+ log_info(_("key not found on keyserver\n"));
+ return;
+ }
}