* getkey.c (parse_auto_key_locate): Silently strip out duplicates rather
authorDavid Shaw <dshaw@jabberwocky.com>
Wed, 22 Mar 2006 23:05:32 +0000 (23:05 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Wed, 22 Mar 2006 23:05:32 +0000 (23:05 +0000)
than causing an error.

g10/ChangeLog
g10/getkey.c

index 3b37911..18c7299 100644 (file)
@@ -1,3 +1,8 @@
+2006-03-22  David Shaw  <dshaw@jabberwocky.com>
+
+       * getkey.c (parse_auto_key_locate): Silently strip out duplicates
+       rather than causing an error.
+
 2006-03-22  Werner Koch  <wk@g10code.com>
 
        * sig-check.c (signature_check2): Changed warning URL to include faq.
index 0a314c4..1c85fb4 100644 (file)
@@ -2934,6 +2934,7 @@ parse_auto_key_locate(char *options)
   while((tok=optsep(&options)))
     {
       struct akl *akl,*last;
+      int dupe=0;
 
       if(tok[0]=='\0')
        continue;
@@ -2969,15 +2970,19 @@ parse_auto_key_locate(char *options)
                 || (akl->type==AKL_SPEC
                     && strcmp(last->spec->uri,akl->spec->uri)==0)))
            {
+             dupe=1;
              free_akl(akl);
-             return 0;
+             break;
            }
        }
 
-      if(last)
-       last->next=akl;
-      else
-       opt.auto_key_locate=akl;
+      if(!dupe)
+       {
+         if(last)
+           last->next=akl;
+         else
+           opt.auto_key_locate=akl;
+       }
     }
 
   return 1;