From: Kevin McCarthy Date: Wed, 6 Jan 2016 02:08:07 +0000 (-0800) Subject: Allow tab as a delimiter in smime .index files. (closes #3802) X-Git-Tag: neomutt-20160404~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=51ea90f533336eb8909c859502a17f7be7c29aba;p=neomutt Allow tab as a delimiter in smime .index files. (closes #3802) The old parsing code used fscanf, and so happened to allow a tab as a delimiter. Even though smime_keys.pl uses a space, some users maintain their own .index files by hand (using tab delimiters), so continue to allow that delimiter. Thanks to Andre for the bug report and patch. --- diff --git a/smime.c b/smime.c index edd312b92..7f9a8b537 100644 --- a/smime.c +++ b/smime.c @@ -509,7 +509,12 @@ static smime_key_t *smime_parse_key(char *buf) for (p = buf; p; p = pend) { - if ((pend = strchr (p, ' ')) || (pend = strchr (p, '\n'))) + /* Some users manually maintain their .index file, and use a tab + * as a delimiter, which the old parsing code (using fscanf) + * happened to allow. smime_keys.pl uses a space, so search for both. + */ + if ((pend = strchr (p, ' ')) || (pend = strchr (p, '\t')) || + (pend = strchr (p, '\n'))) *pend++ = 0; /* For backward compatibility, don't count consecutive delimiters