From 680b36b82a67b3e53547d003fcd12c4ff4461ea8 Mon Sep 17 00:00:00 2001 From: Federico Kircheis Date: Sun, 30 Jun 2019 05:23:18 +0200 Subject: [PATCH] Replace `public` variable with `only_public_key` `public` is a reserved keyword in c++ --- ncrypt/smime.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/ncrypt/smime.c b/ncrypt/smime.c index a0b7d76f4..fdb577820 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -703,11 +703,11 @@ static struct SmimeKey *smime_parse_key(char *buf) /** * smime_get_candidates - Find keys matching a string - * @param search String to match - * @param public If true, only get the public keys + * @param search String to match + * @param only_public_key If true, only get the public keys * @retval ptr Matching key */ -static struct SmimeKey *smime_get_candidates(char *search, bool public) +static struct SmimeKey *smime_get_candidates(char *search, bool only_public_key) { char index_file[PATH_MAX]; char buf[1024]; @@ -715,7 +715,7 @@ static struct SmimeKey *smime_get_candidates(char *search, bool public) struct SmimeKey **results_end = &results; snprintf(index_file, sizeof(index_file), "%s/.index", - public ? NONULL(C_SmimeCertificates) : NONULL(C_SmimeKeys)); + only_public_key ? NONULL(C_SmimeCertificates) : NONULL(C_SmimeKeys)); FILE *fp = mutt_file_fopen(index_file, "r"); if (!fp) @@ -744,17 +744,17 @@ static struct SmimeKey *smime_get_candidates(char *search, bool public) /** * smime_get_key_by_hash - Find a key by its hash - * @param hash Hash to find - * @param public If true, only get the public keys + * @param hash Hash to find + * @param only_public_key If true, only get the public keys * @retval ptr Matching key * * Returns the first matching key record, without prompting or checking of * abilities or trust. */ -static struct SmimeKey *smime_get_key_by_hash(char *hash, bool public) +static struct SmimeKey *smime_get_key_by_hash(char *hash, bool only_public_key) { struct SmimeKey *match = NULL; - struct SmimeKey *results = smime_get_candidates(hash, public); + struct SmimeKey *results = smime_get_candidates(hash, only_public_key); for (struct SmimeKey *result = results; result; result = result->next) { if (mutt_str_strcasecmp(hash, result->hash) == 0) @@ -771,14 +771,14 @@ static struct SmimeKey *smime_get_key_by_hash(char *hash, bool public) /** * smime_get_key_by_addr - Find an SIME key by address - * @param mailbox Email address to match - * @param abilities Abilities to match, see #KeyFlags - * @param public If true, only get the public keys - * @param may_ask If true, the user may be asked to select a key + * @param mailbox Email address to match + * @param abilities Abilities to match, see #KeyFlags + * @param only_public_key If true, only get the public keys + * @param may_ask If true, the user may be asked to select a key * @retval ptr Matching key */ static struct SmimeKey *smime_get_key_by_addr(char *mailbox, KeyFlags abilities, - bool public, bool may_ask) + bool only_public_key, bool may_ask) { if (!mailbox) return NULL; @@ -792,7 +792,7 @@ static struct SmimeKey *smime_get_key_by_addr(char *mailbox, KeyFlags abilities, struct SmimeKey *return_key = NULL; bool multi_trusted_matches = false; - results = smime_get_candidates(mailbox, public); + results = smime_get_candidates(mailbox, only_public_key); for (result = results; result; result = result->next) { if (abilities && !(result->flags & abilities)) @@ -851,12 +851,12 @@ static struct SmimeKey *smime_get_key_by_addr(char *mailbox, KeyFlags abilities, /** * smime_get_key_by_str - Find an SMIME key by string - * @param str String to match - * @param abilities Abilities to match, see #KeyFlags - * @param public If true, only get the public keys + * @param str String to match + * @param abilities Abilities to match, see #KeyFlags + * @param only_public_key If true, only get the public keys * @retval ptr Matching key */ -static struct SmimeKey *smime_get_key_by_str(char *str, KeyFlags abilities, bool public) +static struct SmimeKey *smime_get_key_by_str(char *str, KeyFlags abilities, bool only_public_key) { if (!str) return NULL; @@ -867,7 +867,7 @@ static struct SmimeKey *smime_get_key_by_str(char *str, KeyFlags abilities, bool struct SmimeKey *match = NULL; struct SmimeKey *return_key = NULL; - results = smime_get_candidates(str, public); + results = smime_get_candidates(str, only_public_key); for (result = results; result; result = result->next) { if (abilities && !(result->flags & abilities)) @@ -897,12 +897,12 @@ static struct SmimeKey *smime_get_key_by_str(char *str, KeyFlags abilities, bool /** * smime_ask_for_key - Ask the user to select a key - * @param prompt Prompt to show the user - * @param abilities Abilities to match, see #KeyFlags - * @param public If true, only get the public keys + * @param prompt Prompt to show the user + * @param abilities Abilities to match, see #KeyFlags + * @param only_public_key If true, only get the public keys * @retval ptr Selected SMIME key */ -static struct SmimeKey *smime_ask_for_key(char *prompt, KeyFlags abilities, bool public) +static struct SmimeKey *smime_ask_for_key(char *prompt, KeyFlags abilities, bool only_public_key) { struct SmimeKey *key = NULL; char resp[128]; @@ -918,7 +918,7 @@ static struct SmimeKey *smime_ask_for_key(char *prompt, KeyFlags abilities, bool if (mutt_get_field(prompt, resp, sizeof(resp), MUTT_CLEAR) != 0) return NULL; - key = smime_get_key_by_str(resp, abilities, public); + key = smime_get_key_by_str(resp, abilities, only_public_key); if (key) return key; -- 2.40.0