changeset: 6551:7c0bd34546f4
user:      Kevin McCarthy <[email protected]>
date:      Tue Jan 05 18:08:07 2016 -0800
link:      http://dev.mutt.org/hg/mutt/rev/7c0bd34546f4

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.

diffs (17 lines):

diff -r cf4c1c21e58d -r 7c0bd34546f4 smime.c
--- a/smime.c   Mon Jan 04 16:28:56 2016 -0800
+++ b/smime.c   Tue Jan 05 18:08:07 2016 -0800
@@ -509,7 +509,12 @@
 
   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

Reply via email to