]> granicus.if.org Git - neomutt/commitdiff
comment and reorder params
authorRichard Russon <rich@flatcap.org>
Sat, 7 Apr 2018 22:59:34 +0000 (23:59 +0100)
committerRichard Russon <rich@flatcap.org>
Sat, 7 Apr 2018 22:59:34 +0000 (23:59 +0100)
ncrypt/crypt_gpgme.c
ncrypt/pgpkey.c

index 6bbdd794e601c21c20be615fd7730780e862c57a..b110e0d4bfdb3c437133a5054b59f28c789accca 100644 (file)
@@ -4109,11 +4109,14 @@ static struct CryptKeyInfo *get_candidates(struct ListHead *hints, unsigned int
 }
 
 /**
- * crypt_add_string_to_hints - Add the string STR to the list HINTS
+ * crypt_add_string_to_hints - Split a string and add the parts to a List
+ * @param[in]  str   String to parse
+ * @param[out] hints List of string parts
  *
- * This list is later used to match addresses.
+ * The string str is split by whitespace and punctuation and the parts added to
+ * hints.  This list is later used to match addresses.
  */
-static void crypt_add_string_to_hints(struct ListHead *hints, const char *str)
+static void crypt_add_string_to_hints(const char *str, struct ListHead *hints)
 {
   char *scratch = mutt_str_strdup(str);
   if (!scratch)
@@ -4348,9 +4351,9 @@ static struct CryptKeyInfo *crypt_getkeybyaddr(struct Address *a,
   *forced_valid = 0;
 
   if (a && a->mailbox)
-    crypt_add_string_to_hints(&hints, a->mailbox);
+    crypt_add_string_to_hints(a->mailbox, &hints);
   if (a && a->personal)
-    crypt_add_string_to_hints(&hints, a->personal);
+    crypt_add_string_to_hints(a->personal, &hints);
 
   if (!oppenc_mode)
     mutt_message(_("Looking for keys matching \"%s\"..."), a ? a->mailbox : "");
@@ -4467,7 +4470,7 @@ static struct CryptKeyInfo *crypt_getkeybystr(char *p, short abilities,
   *forced_valid = 0;
 
   const char *pfcopy = crypt_get_fingerprint_or_id(p, &phint, &pl, &ps);
-  crypt_add_string_to_hints(&hints, phint);
+  crypt_add_string_to_hints(phint, &hints);
   struct CryptKeyInfo *keys = get_candidates(&hints, app, (abilities & KEYFLAG_CANSIGN));
   mutt_list_free(&hints);
 
index f27dee48122e8f4f21c0e5a089ef045a174f51b7..3559e3111e86de3350d5d70bfb527aacc08f8dad 100644 (file)
@@ -802,7 +802,15 @@ struct Body *pgp_make_key_attachment(char *tempf)
   return att;
 }
 
-static void pgp_add_string_to_hints(struct ListHead *hints, const char *str)
+/**
+ * pgp_add_string_to_hints - Split a string and add the parts to a List
+ * @param[in]  str   String to parse
+ * @param[out] hints List of string parts
+ *
+ * The string str is split by whitespace and punctuation and the parts added to
+ * hints.
+ */
+static void pgp_add_string_to_hints(const char *str, struct ListHead *hints)
 {
   char *scratch = mutt_str_strdup(str);
   if (!scratch)
@@ -845,9 +853,9 @@ struct PgpKeyInfo *pgp_getkeybyaddr(struct Address *a, short abilities,
   struct PgpUid *q = NULL;
 
   if (a->mailbox)
-    pgp_add_string_to_hints(&hints, a->mailbox);
+    pgp_add_string_to_hints(a->mailbox, &hints);
   if (a->personal)
-    pgp_add_string_to_hints(&hints, a->personal);
+    pgp_add_string_to_hints(a->personal, &hints);
 
   if (!oppenc_mode)
     mutt_message(_("Looking for keys matching \"%s\"..."), a->mailbox);
@@ -976,7 +984,7 @@ struct PgpKeyInfo *pgp_getkeybystr(char *p, short abilities, enum PgpRing keyrin
   mutt_message(_("Looking for keys matching \"%s\"..."), p);
 
   pfcopy = crypt_get_fingerprint_or_id(p, &phint, &pl, &ps);
-  pgp_add_string_to_hints(&hints, phint);
+  pgp_add_string_to_hints(phint, &hints);
   keys = pgp_get_candidates(keyring, &hints);
   mutt_list_free(&hints);